From f7ea414dc89ed030dadabb0c52ed76e8c4a4d1ab Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 20 Aug 2024 10:19:27 +0000 Subject: [PATCH] Update docs from maps rnmapbox/maps@e5b1ca5 --- ...Entry-8735e103af39051ceecd27aa8a5599c6.js} | 1781 +++++++++-------- static/example-app/index.html | 2 +- 2 files changed, 964 insertions(+), 819 deletions(-) rename static/example-app/_expo/static/js/web/{AppEntry-3315fa0cb376701554f2444e65a7c3d9.js => AppEntry-8735e103af39051ceecd27aa8a5599c6.js} (59%) diff --git a/static/example-app/_expo/static/js/web/AppEntry-3315fa0cb376701554f2444e65a7c3d9.js b/static/example-app/_expo/static/js/web/AppEntry-8735e103af39051ceecd27aa8a5599c6.js similarity index 59% rename from static/example-app/_expo/static/js/web/AppEntry-3315fa0cb376701554f2444e65a7c3d9.js rename to static/example-app/_expo/static/js/web/AppEntry-8735e103af39051ceecd27aa8a5599c6.js index e4c6c27..d3b2baa 100644 --- a/static/example-app/_expo/static/js/web/AppEntry-3315fa0cb376701554f2444e65a7c3d9.js +++ b/static/example-app/_expo/static/js/web/AppEntry-8735e103af39051ceecd27aa8a5599c6.js @@ -1,45 +1,129 @@ var __BUNDLE_START_TIME__=this.nativePerformanceNow?nativePerformanceNow():Date.now(),__DEV__=false,process=this.process||{},__METRO_GLOBAL_PREFIX__='';process.env=process.env||{};process.env.NODE_ENV=process.env.NODE_ENV||"production"; -!(function(e){"use strict";e.__r=i,e[`${__METRO_GLOBAL_PREFIX__}__d`]=function(e,n,o){if(t.has(n))return;const i={dependencyMap:o,factory:e,hasError:!1,importedAll:r,importedDefault:r,isInitialized:!1,publicModule:{exports:{}}};t.set(n,i)},e.__c=o,e.__registerSegment=function(e,r,n){p[e]=r,n&&n.forEach((r=>{t.has(r)||h.has(r)||h.set(r,e)}))};var t=o();const r={},{hasOwnProperty:n}={};function o(){return t=new Map}function i(e){const r=e,n=t.get(r);return n&&n.isInitialized?n.publicModule.exports:d(r,n)}function l(e){const n=e,o=t.get(n);if(o&&o.importedDefault!==r)return o.importedDefault;const l=i(n),u=l&&l.__esModule?l.default:l;return t.get(n).importedDefault=u}function u(e){const o=e,l=t.get(o);if(l&&l.importedAll!==r)return l.importedAll;const u=i(o);let c;if(u&&u.__esModule)c=u;else{if(c={},u)for(const e in u)n.call(u,e)&&(c[e]=u[e]);c.default=u}return t.get(o).importedAll=c}i.importDefault=l,i.importAll=u,i.context=function(){throw new Error("The experimental Metro feature `require.context` is not enabled in your project.")},i.resolveWeak=function(){throw new Error("require.resolveWeak cannot be called dynamically.")};let c=!1;function d(t,r){if(!c&&e.ErrorUtils){let n;c=!0;try{n=g(t,r)}catch(t){e.ErrorUtils.reportFatalError(t)}return c=!1,n}return g(t,r)}const a=16,s=65535;function f(e){return{segmentId:e>>>a,localId:e&s}}i.unpackModuleId=f,i.packModuleId=function(e){return(e.segmentId<0){const e=h.get(r)??0,o=p[e];null!=o&&(o(r),n=t.get(r),h.delete(r))}const o=e.nativeRequire;if(!n&&o){const{segmentId:e,localId:i}=f(r);o(i,e),n=t.get(r)}if(!n)throw _(r);if(n.hasError)throw n.error;n.isInitialized=!0;const{factory:c,dependencyMap:d}=n;try{const t=n.publicModule;return t.id=r,c(e,i,l,u,t,t.exports,d),n.factory=void 0,n.dependencyMap=void 0,t.exports}catch(e){throw n.hasError=!0,n.error=e,n.isInitialized=!1,n.publicModule.exports=void 0,e}}function _(e){return Error('Requiring unknown module "'+e+'".')}})('undefined'!=typeof globalThis?globalThis:'undefined'!=typeof global?global:'undefined'!=typeof window?window:this); -!(function(e){e.$$require_external=()=>null})('undefined'!=typeof globalThis?globalThis:'undefined'!=typeof global?global:'undefined'!=typeof window?window:this); +!(function(e){"use strict";e.__r=f,e[`${__METRO_GLOBAL_PREFIX__}__d`]=function(n,o,i){if(r.has(o)){if(__DEV__){var l=arguments[4];l&&e.__accept(o,n,i,l)}return}var u={dependencyMap:i,factory:n,hasError:!1,importedAll:t,importedDefault:t,isInitialized:!1,publicModule:{exports:{}}};if(r.set(o,u),__DEV__){u.hot=b();var f=arguments[3];f&&(u.verboseName=f,a.set(f,o))}},e.__c=i,e.__registerSegment=function(e,t,n){if(y[e]=t,__DEV__){if(0===e&&n)throw new Error("registerSegment: Expected moduleIds to be null for main segment");if(0!==e&&!n)throw new Error("registerSegment: Expected moduleIds to be passed for segment #"+e)}n&&n.forEach((function(t){r.has(t)||E.has(t)||E.set(t,e)}))};var r=i(),t={},n={},o={}.hasOwnProperty;function i(){return r=new Map}if(__DEV__&&(e.$RefreshReg$=function(){},e.$RefreshSig$=function(){return function(e){return e}}),__DEV__)var a=new Map,l=function(e){var r=a.get(e);if(null==r)throw new Error(`Unknown named module: "${e}"`);return r},u=[];function f(e){if(__DEV__&&"string"==typeof e){var t=e;e=l(t),console.warn(`Requiring module "${t}" by name is only supported for debugging purposes and will BREAK IN PRODUCTION!`)}var n=e;if(__DEV__){var o=u.indexOf(n);if(-1!==o){var i=u.slice(o).map((function(e){var t,n;return null!=(t=null==(n=r.get(e))?void 0:n.verboseName)?t:"[unknown]"}));c(i)&&(i.push(i[0]),console.warn(`Require cycle: ${i.join(" -> ")}\n\nRequire cycles are allowed, but can result in uninitialized values. Consider refactoring to remove the need for a cycle.`))}}var a=r.get(n);return a&&a.isInitialized?a.publicModule.exports:p(n,a)}function c(r){var t=e[__METRO_GLOBAL_PREFIX__+"__requireCycleIgnorePatterns"];if(!Array.isArray(t))return!0;var n=function(e){return null!=e&&t.some((function(r){return r.test(e)}))};return r.every((function(e){return!n(e)}))}function d(e){__DEV__&&"string"==typeof e&&(e=l(e));var n=e,o=r.get(n);if(o&&o.importedDefault!==t)return o.importedDefault;var i=f(n),a=i&&i.__esModule?i.default:i;return r.get(n).importedDefault=a}function s(e){__DEV__&&"string"==typeof e&&(e=l(e));var n=e,i=r.get(n);if(i&&i.importedAll!==t)return i.importedAll;var a,u=f(n);if(u&&u.__esModule)a=u;else{if(a={},u)for(var c in u)o.call(u,c)&&(a[c]=u[c]);a.default=u}return r.get(n).importedAll=a}f.importDefault=d,f.importAll=s,f.context=function(){if(__DEV__)throw new Error("The experimental Metro feature `require.context` is not enabled in your project.\nThis can be enabled by setting the `transformer.unstable_allowRequireContext` property to `true` in your Metro configuration.");throw new Error("The experimental Metro feature `require.context` is not enabled in your project.")},f.resolveWeak=function(){if(__DEV__)throw new Error("require.resolveWeak cannot be called dynamically. Ensure you are using the same version of `metro` and `metro-runtime`.");throw new Error("require.resolveWeak cannot be called dynamically.")};var _=!1;function p(r,t){if(!_&&e.ErrorUtils){var n;_=!0;try{n=w(r,t)}catch(r){e.ErrorUtils.reportFatalError(r)}return _=!1,n}return w(r,t)}var v=16,h=65535;function g(e){return{segmentId:e>>>v,localId:e&h}}f.unpackModuleId=g,f.packModuleId=function(e){return(e.segmentId<0){var o,i=null!=(o=E.get(t))?o:0,a=y[i];null!=a&&(a(t),n=r.get(t),E.delete(t))}var l=e.nativeRequire;if(!n&&l){var c=g(t),_=c.segmentId;l(c.localId,_),n=r.get(t)}if(!n)throw m(t);if(n.hasError)throw n.error;if(__DEV__)var p=A(),v=C();n.isInitialized=!0;var h=n,w=h.factory,b=h.dependencyMap;__DEV__&&u.push(t);try{__DEV__&&p.beginEvent("JS_require_"+(n.verboseName||t));var R=n.publicModule;if(__DEV__){R.hot=n.hot;var M=e.$RefreshReg$,D=e.$RefreshSig$;if(null!=v){var x=v;e.$RefreshReg$=function(e,r){x.register(e,t+" "+r)},e.$RefreshSig$=x.createSignatureFunctionForTransform}}return R.id=t,w(e,f,d,s,R,R.exports,b),__DEV__||(n.factory=void 0,n.dependencyMap=void 0),__DEV__&&(p.endEvent(),null!=v&&k(v,R.exports,t)),R.exports}catch(e){throw n.hasError=!0,n.error=e,n.isInitialized=!1,n.publicModule.exports=void 0,e}finally{if(__DEV__){if(u.pop()!==t)throw new Error("initializingModuleIds is corrupt; something is terribly wrong");e.$RefreshReg$=M,e.$RefreshSig$=D}}}function m(e){var r='Requiring unknown module "'+e+'".';return __DEV__&&(r+=" If you are sure the module exists, try restarting Metro. You may also want to run `yarn` or `npm install`."),Error(r)}if(__DEV__){f.Systrace={beginEvent:function(){},endEvent:function(){}},f.getModules=function(){return r};var b=function(){var e={_acceptCallback:null,_disposeCallback:null,_didAccept:!1,accept:function(r){e._didAccept=!0,e._acceptCallback=r},dispose:function(r){e._disposeCallback=r}};return e},R=null,M=function(e,r,t){var o=[],i=new Set,a=new Set;function l(e){if(a.has(e))throw n;if(!i.has(e)){i.add(e),a.add(e);var u=r(e);t(e)?a.delete(e):(u.forEach((function(e){l(e)})),a.delete(e),o.push(e))}}return e.forEach((function(e){l(e)})),o},D=function(e,n,o){var i=r.get(e);if(null==i)throw new Error("[Refresh] Expected to find the module.");var a=i.hot;if(!a)throw new Error("[Refresh] Expected module.hot to always exist in DEV.");if(a._disposeCallback)try{a._disposeCallback()}catch(r){console.error(`Error while calling dispose handler for module ${e}: `,r)}n&&(i.factory=n),o&&(i.dependencyMap=o),i.hasError=!1,i.error=void 0,i.importedAll=t,i.importedDefault=t,i.isInitialized=!1;var l=i.publicModule.exports;if(i.publicModule.exports={},a._didAccept=!1,a._acceptCallback=null,a._disposeCallback=null,f(e),i.hasError)return i.hasError=!1,i.isInitialized=!0,i.error=null,i.publicModule.exports=l,!0;if(a._acceptCallback)try{a._acceptCallback()}catch(r){console.error(`Error while calling accept handler for module ${e}: `,r)}return!1},x=function(e,r){if("undefined"!=typeof window&&null!=window.location&&"function"==typeof window.location.reload)window.location.reload();else{var t=C();if(null!=t){var n,o,i,a,l=null!=(n=null==(o=r.source)?void 0:o.verboseName)?n:"unknown",u=null!=(i=null==(a=r.failed)?void 0:a.verboseName)?i:"unknown";t.performFullRefresh(`Fast Refresh - ${e} <${l}> <${u}>`)}else console.warn("Could not reload the application after an edit.")}},I=function(e,r){if(e.isLikelyComponentType(r))return!0;if(null==r||"object"!=typeof r)return!1;var t=!1,n=!0;for(var o in r)if(t=!0,"__esModule"!==o){var i=Object.getOwnPropertyDescriptor(r,o);if(i&&i.get)return!1;var a=r[o];e.isLikelyComponentType(a)||(n=!1)}return t&&n},$=function(e,r,t){var n=V(e,r),o=V(e,t);if(n.length!==o.length)return!0;for(var i=0;it,reportError(r){t&&t(r,!1)},reportFatalError(r){t&&t(r,!0)},applyWithGuard(r,t,e,o,a){try{return n++,r.apply(t,e)}catch(r){l.reportError(r)}finally{n--}return null},applyWithGuardIfNeeded:(r,n,t)=>l.inGuard()?r.apply(n,t):(l.applyWithGuard(r,n,t),null),inGuard:()=>!!n,guard(r,n,t){if('function'!=typeof r)return console.warn('A function must be passed to ErrorUtils.guard, got ',r),null;const e=n??r.name??'';return function(...n){return l.applyWithGuard(r,t??this,n,null,e)}}};r.ErrorUtils=l})('undefined'!=typeof globalThis?globalThis:'undefined'!=typeof global?global:'undefined'!=typeof window?window:this); -__d((function(g,r,i,a,m,e,d){var f=r(d[0]),t=f(r(d[1])),u=f(r(d[2]));(0,t.default)(u.default)}),0,[1,2,78]); +!(function(n){var r=0,t=function(n,r){throw n},l={setGlobalHandler:function(n){t=n},getGlobalHandler:function(){return t},reportError:function(n){t&&t(n,!1)},reportFatalError:function(n){t&&t(n,!0)},applyWithGuard:function(n,t,u,o,e){try{return r++,n.apply(t,u)}catch(n){l.reportError(n)}finally{r--}return null},applyWithGuardIfNeeded:function(n,r,t){return l.inGuard()?n.apply(r,t):(l.applyWithGuard(n,r,t),null)},inGuard:function(){return!!r},guard:function(n,r,t){var u;if('function'!=typeof n)return console.warn('A function must be passed to ErrorUtils.guard, got ',n),null;var o=null!=(u=null!=r?r:n.name)?u:'';return function(){for(var r=arguments.length,u=new Array(r),e=0;eo));{const t=document.getElementById('root');n.default.runApplication('main',{rootTag:t,hydrate:'1'===process.env.EXPO_PUBLIC_USE_STATIC})}},r(d[1]);var n=t(r(d[2]));t(r(d[3]))}),2,[1,3,4,77]); -__d((function(g,r,i,a,m,e,d){}),3,[]); -__d((function(g,_r,_i,_a,m,_e,d){var t=_r(d[0]);Object.defineProperty(_e,"__esModule",{value:!0}),_e.default=void 0;t(_r(d[1]));var e=t(_r(d[2])),r=t(_r(d[3])),n=(function(t,e){if(!e&&t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var r=i(e);if(r&&r.has(t))return r.get(t);var n={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in t)if("default"!==a&&{}.hasOwnProperty.call(t,a)){var p=o?Object.getOwnPropertyDescriptor(t,a):null;p&&(p.get||p.set)?Object.defineProperty(n,a,p):n[a]=t[a]}return n.default=t,r&&r.set(t,n),n})(_r(d[4]));function i(t){if("function"!=typeof WeakMap)return null;var e=new WeakMap,r=new WeakMap;return(i=function(t){return t?r:e})(t)}var o,a={},p={},u=t=>t();class l{static getAppKeys(){return Object.keys(p)}static getApplication(t,r){return(0,e.default)(p[t]&&p[t].getApplication,"Application "+t+" has not been registered. This is either due to an import error during initialization or failure to call AppRegistry.registerComponent."),p[t].getApplication(r)}static registerComponent(t,e){return p[t]={getApplication:t=>(0,n.getApplication)(u(e),t?t.initialProps:a,o&&o(t)),run:t=>(0,n.default)(u(e),o&&o(t),t.callback,{hydrate:t.hydrate||!1,initialProps:t.initialProps||a,mode:t.mode||'concurrent',rootTag:t.rootTag})},t}static registerConfig(t){t.forEach((t=>{var r=t.appKey,n=t.component,i=t.run;i?l.registerRunnable(r,i):((0,e.default)(n,'No component provider passed in'),l.registerComponent(r,n))}))}static registerRunnable(t,e){return p[t]={run:e},t}static runApplication(t,r){return(0,e.default)(p[t]&&p[t].run,"Application \""+t+"\" has not been registered. This is either due to an import error during initialization or failure to call AppRegistry.registerComponent."),p[t].run(r)}static setComponentProviderInstrumentationHook(t){u=t}static setWrapperComponentProvider(t){o=t}static unmountApplicationComponentAtRootTag(t){(0,r.default)(t)}}_e.default=l}),4,[1,5,10,11,18]); -__d((function(g,_r,i,a,m,_e,d){function e(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,o)}return r}m.exports=function(t){for(var r=1;r2?t-2:0),s=2;s-1}}),7,[]); +__d((function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=t(r(d[1])),o={article:'article',banner:'header',blockquote:'blockquote',button:'button',code:'code',complementary:'aside',contentinfo:'footer',deletion:'del',emphasis:'em',figure:'figure',insertion:'ins',form:'form',list:'ul',listitem:'li',main:'main',navigation:'nav',paragraph:'p',region:'section',strong:'strong'},l={};e.default=function(t){if(void 0===t&&(t=l),'label'===(t.role||t.accessibilityRole))return'label';var u=(0,n.default)(t);if(u){if('heading'===u){var c=t.accessibilityLevel||t['aria-level'];return null!=c?"h"+c:'h1'}return o[u]}}}),8,[1,9]); +__d((function(g,r,i,a,m,e,d){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var l={adjustable:'slider',button:'button',header:'heading',image:'img',imagebutton:null,keyboardkey:null,label:null,link:'link',none:'presentation',search:'search',summary:'region',text:null};e.default=function(n){var t=n.accessibilityRole,u=n.role||t;if(u){var o=l[u];if(null!==o)return o||u}}}),9,[]); +__d((function(g,r,i,a,m,e,d){var l=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var s=l(r(d[1])),c=l(r(d[2])),t=l(r(d[3])),n=l(r(d[4])),u=["aria-activedescendant","accessibilityActiveDescendant","aria-atomic","accessibilityAtomic","aria-autocomplete","accessibilityAutoComplete","aria-busy","accessibilityBusy","aria-checked","accessibilityChecked","aria-colcount","accessibilityColumnCount","aria-colindex","accessibilityColumnIndex","aria-colspan","accessibilityColumnSpan","aria-controls","accessibilityControls","aria-current","accessibilityCurrent","aria-describedby","accessibilityDescribedBy","aria-details","accessibilityDetails","aria-disabled","accessibilityDisabled","aria-errormessage","accessibilityErrorMessage","aria-expanded","accessibilityExpanded","aria-flowto","accessibilityFlowTo","aria-haspopup","accessibilityHasPopup","aria-hidden","accessibilityHidden","aria-invalid","accessibilityInvalid","aria-keyshortcuts","accessibilityKeyShortcuts","aria-label","accessibilityLabel","aria-labelledby","accessibilityLabelledBy","aria-level","accessibilityLevel","aria-live","accessibilityLiveRegion","aria-modal","accessibilityModal","aria-multiline","accessibilityMultiline","aria-multiselectable","accessibilityMultiSelectable","aria-orientation","accessibilityOrientation","aria-owns","accessibilityOwns","aria-placeholder","accessibilityPlaceholder","aria-posinset","accessibilityPosInSet","aria-pressed","accessibilityPressed","aria-readonly","accessibilityReadOnly","aria-required","accessibilityRequired","role","accessibilityRole","aria-roledescription","accessibilityRoleDescription","aria-rowcount","accessibilityRowCount","aria-rowindex","accessibilityRowIndex","aria-rowspan","accessibilityRowSpan","aria-selected","accessibilitySelected","aria-setsize","accessibilitySetSize","aria-sort","accessibilitySort","aria-valuemax","accessibilityValueMax","aria-valuemin","accessibilityValueMin","aria-valuenow","accessibilityValueNow","aria-valuetext","accessibilityValueText","dataSet","focusable","id","nativeID","pointerEvents","style","tabIndex","testID"],o={},b=Object.prototype.hasOwnProperty,y=Array.isArray,p=/[A-Z]/g;function v(l){return'-'+l.toLowerCase()}function w(l){return y(l)?l.join(' '):l}var O=n.default.create({auto:{pointerEvents:'auto'},'box-none':{pointerEvents:'box-none'},'box-only':{pointerEvents:'box-only'},none:{pointerEvents:'none'}});e.default=function(l,y,x){y||(y=o);var U=y,S=U['aria-activedescendant'],C=U.accessibilityActiveDescendant,h=U['aria-atomic'],R=U.accessibilityAtomic,I=U['aria-autocomplete'],D=U.accessibilityAutoComplete,f=U['aria-busy'],M=U.accessibilityBusy,P=U['aria-checked'],E=U.accessibilityChecked,L=U['aria-colcount'],A=U.accessibilityColumnCount,V=U['aria-colindex'],k=U.accessibilityColumnIndex,B=U['aria-colspan'],q=U.accessibilityColumnSpan,T=U['aria-controls'],z=U.accessibilityControls,H=U['aria-current'],N=U.accessibilityCurrent,F=U['aria-describedby'],K=U.accessibilityDescribedBy,_=U['aria-details'],j=U.accessibilityDetails,Z=U['aria-disabled'],G=U.accessibilityDisabled,J=U['aria-errormessage'],Q=U.accessibilityErrorMessage,W=U['aria-expanded'],X=U.accessibilityExpanded,Y=U['aria-flowto'],$=U.accessibilityFlowTo,ii=U['aria-haspopup'],ei=U.accessibilityHasPopup,ai=U['aria-hidden'],li=U.accessibilityHidden,si=U['aria-invalid'],ci=U.accessibilityInvalid,ti=U['aria-keyshortcuts'],ri=U.accessibilityKeyShortcuts,ni=U['aria-label'],ui=U.accessibilityLabel,di=U['aria-labelledby'],oi=U.accessibilityLabelledBy,bi=U['aria-level'],yi=U.accessibilityLevel,pi=U['aria-live'],vi=U.accessibilityLiveRegion,wi=U['aria-modal'],Oi=U.accessibilityModal,xi=U['aria-multiline'],mi=U.accessibilityMultiline,Ui=U['aria-multiselectable'],Si=U.accessibilityMultiSelectable,Ci=U['aria-orientation'],hi=U.accessibilityOrientation,Ri=U['aria-owns'],Ii=U.accessibilityOwns,Di=U['aria-placeholder'],fi=U.accessibilityPlaceholder,Mi=U['aria-posinset'],Pi=U.accessibilityPosInSet,Ei=U['aria-pressed'],Li=U.accessibilityPressed,Ai=U['aria-readonly'],Vi=U.accessibilityReadOnly,gi=U['aria-required'],ki=U.accessibilityRequired,Bi=(U.role,U.accessibilityRole),qi=U['aria-roledescription'],Ti=U.accessibilityRoleDescription,zi=U['aria-rowcount'],Hi=U.accessibilityRowCount,Ni=U['aria-rowindex'],Fi=U.accessibilityRowIndex,Ki=U['aria-rowspan'],_i=U.accessibilityRowSpan,ji=U['aria-selected'],Zi=U.accessibilitySelected,Gi=U['aria-setsize'],Ji=U.accessibilitySetSize,Qi=U['aria-sort'],Wi=U.accessibilitySort,Xi=U['aria-valuemax'],Yi=U.accessibilityValueMax,$i=U['aria-valuemin'],ie=U.accessibilityValueMin,ee=U['aria-valuenow'],ae=U.accessibilityValueNow,le=U['aria-valuetext'],se=U.accessibilityValueText,ce=U.dataSet,te=U.focusable,re=U.id,ne=U.nativeID,ue=U.pointerEvents,de=U.style,oe=U.tabIndex,be=U.testID,ye=(0,c.default)(U,u);null!=G&&(0,r(d[5]).warnOnce)('accessibilityDisabled',"accessibilityDisabled is deprecated.");var pe=Z||G,ve=t.default.propsToAriaRole(y);null!=C&&(0,r(d[5]).warnOnce)('accessibilityActiveDescendant',"accessibilityActiveDescendant is deprecated. Use aria-activedescendant.");var we=null!=S?S:C;null!=we&&(ye['aria-activedescendant']=we),null!=R&&(0,r(d[5]).warnOnce)('accessibilityAtomic',"accessibilityAtomic is deprecated. Use aria-atomic.");var Oe=null!=h?S:R;null!=Oe&&(ye['aria-atomic']=Oe),null!=D&&(0,r(d[5]).warnOnce)('accessibilityAutoComplete',"accessibilityAutoComplete is deprecated. Use aria-autocomplete.");var xe=null!=I?I:D;null!=xe&&(ye['aria-autocomplete']=xe),null!=M&&(0,r(d[5]).warnOnce)('accessibilityBusy',"accessibilityBusy is deprecated. Use aria-busy.");var me=null!=f?f:M;null!=me&&(ye['aria-busy']=me),null!=E&&(0,r(d[5]).warnOnce)('accessibilityChecked',"accessibilityChecked is deprecated. Use aria-checked.");var Ue=null!=P?P:E;null!=Ue&&(ye['aria-checked']=Ue),null!=A&&(0,r(d[5]).warnOnce)('accessibilityColumnCount',"accessibilityColumnCount is deprecated. Use aria-colcount.");var Se=null!=L?L:A;null!=Se&&(ye['aria-colcount']=Se),null!=k&&(0,r(d[5]).warnOnce)('accessibilityColumnIndex',"accessibilityColumnIndex is deprecated. Use aria-colindex.");var Ce=null!=V?V:k;null!=Ce&&(ye['aria-colindex']=Ce),null!=q&&(0,r(d[5]).warnOnce)('accessibilityColumnSpan',"accessibilityColumnSpan is deprecated. Use aria-colspan.");var he=null!=B?B:q;null!=he&&(ye['aria-colspan']=he),null!=z&&(0,r(d[5]).warnOnce)('accessibilityControls',"accessibilityControls is deprecated. Use aria-controls.");var Re=null!=T?T:z;null!=Re&&(ye['aria-controls']=w(Re)),null!=N&&(0,r(d[5]).warnOnce)('accessibilityCurrent',"accessibilityCurrent is deprecated. Use aria-current.");var Ie=null!=H?H:N;null!=Ie&&(ye['aria-current']=Ie),null!=K&&(0,r(d[5]).warnOnce)('accessibilityDescribedBy',"accessibilityDescribedBy is deprecated. Use aria-describedby.");var De=null!=F?F:K;null!=De&&(ye['aria-describedby']=w(De)),null!=j&&(0,r(d[5]).warnOnce)('accessibilityDetails',"accessibilityDetails is deprecated. Use aria-details.");var fe=null!=_?_:j;null!=fe&&(ye['aria-details']=fe),!0===pe&&(ye['aria-disabled']=!0,'button'!==l&&'form'!==l&&'input'!==l&&'select'!==l&&'textarea'!==l||(ye.disabled=!0)),null!=Q&&(0,r(d[5]).warnOnce)('accessibilityErrorMessage',"accessibilityErrorMessage is deprecated. Use aria-errormessage.");var Me=null!=J?J:Q;null!=Me&&(ye['aria-errormessage']=Me),null!=X&&(0,r(d[5]).warnOnce)('accessibilityExpanded',"accessibilityExpanded is deprecated. Use aria-expanded.");var Pe=null!=W?W:X;null!=Pe&&(ye['aria-expanded']=Pe),null!=$&&(0,r(d[5]).warnOnce)('accessibilityFlowTo',"accessibilityFlowTo is deprecated. Use aria-flowto.");var Ee=null!=Y?Y:$;null!=Ee&&(ye['aria-flowto']=w(Ee)),null!=ei&&(0,r(d[5]).warnOnce)('accessibilityHasPopup',"accessibilityHasPopup is deprecated. Use aria-haspopup.");var Le=null!=ii?ii:ei;null!=Le&&(ye['aria-haspopup']=Le),null!=li&&(0,r(d[5]).warnOnce)('accessibilityHidden',"accessibilityHidden is deprecated. Use aria-hidden.");var Ae=null!=ai?ai:li;!0===Ae&&(ye['aria-hidden']=Ae),null!=ci&&(0,r(d[5]).warnOnce)('accessibilityInvalid',"accessibilityInvalid is deprecated. Use aria-invalid.");var Ve=null!=si?si:ci;null!=Ve&&(ye['aria-invalid']=Ve),null!=ri&&(0,r(d[5]).warnOnce)('accessibilityKeyShortcuts',"accessibilityKeyShortcuts is deprecated. Use aria-keyshortcuts.");var ge=null!=ti?ti:ri;null!=ge&&(ye['aria-keyshortcuts']=w(ge)),null!=ui&&(0,r(d[5]).warnOnce)('accessibilityLabel',"accessibilityLabel is deprecated. Use aria-label.");var ke=null!=ni?ni:ui;null!=ke&&(ye['aria-label']=ke),null!=oi&&(0,r(d[5]).warnOnce)('accessibilityLabelledBy',"accessibilityLabelledBy is deprecated. Use aria-labelledby.");var Be=null!=di?di:oi;null!=Be&&(ye['aria-labelledby']=w(Be)),null!=yi&&(0,r(d[5]).warnOnce)('accessibilityLevel',"accessibilityLevel is deprecated. Use aria-level.");var qe=null!=bi?bi:yi;null!=qe&&(ye['aria-level']=qe),null!=vi&&(0,r(d[5]).warnOnce)('accessibilityLiveRegion',"accessibilityLiveRegion is deprecated. Use aria-live.");var Te=null!=pi?pi:vi;null!=Te&&(ye['aria-live']='none'===Te?'off':Te),null!=Oi&&(0,r(d[5]).warnOnce)('accessibilityModal',"accessibilityModal is deprecated. Use aria-modal.");var ze=null!=wi?wi:Oi;null!=ze&&(ye['aria-modal']=ze),null!=mi&&(0,r(d[5]).warnOnce)('accessibilityMultiline',"accessibilityMultiline is deprecated. Use aria-multiline.");var He=null!=xi?xi:mi;null!=He&&(ye['aria-multiline']=He),null!=Si&&(0,r(d[5]).warnOnce)('accessibilityMultiSelectable',"accessibilityMultiSelectable is deprecated. Use aria-multiselectable.");var Ne=null!=Ui?Ui:Si;null!=Ne&&(ye['aria-multiselectable']=Ne),null!=hi&&(0,r(d[5]).warnOnce)('accessibilityOrientation',"accessibilityOrientation is deprecated. Use aria-orientation.");var Fe=null!=Ci?Ci:hi;null!=Fe&&(ye['aria-orientation']=Fe),null!=Ii&&(0,r(d[5]).warnOnce)('accessibilityOwns',"accessibilityOwns is deprecated. Use aria-owns.");var Ke=null!=Ri?Ri:Ii;null!=Ke&&(ye['aria-owns']=w(Ke)),null!=fi&&(0,r(d[5]).warnOnce)('accessibilityPlaceholder',"accessibilityPlaceholder is deprecated. Use aria-placeholder.");var _e=null!=Di?Di:fi;null!=_e&&(ye['aria-placeholder']=_e),null!=Pi&&(0,r(d[5]).warnOnce)('accessibilityPosInSet',"accessibilityPosInSet is deprecated. Use aria-posinset.");var je=null!=Mi?Mi:Pi;null!=je&&(ye['aria-posinset']=je),null!=Li&&(0,r(d[5]).warnOnce)('accessibilityPressed',"accessibilityPressed is deprecated. Use aria-pressed.");var Ze=null!=Ei?Ei:Li;null!=Ze&&(ye['aria-pressed']=Ze),null!=Vi&&(0,r(d[5]).warnOnce)('accessibilityReadOnly',"accessibilityReadOnly is deprecated. Use aria-readonly.");var Ge=null!=Ai?Ai:Vi;null!=Ge&&(ye['aria-readonly']=Ge,'input'!==l&&'select'!==l&&'textarea'!==l||(ye.readOnly=!0)),null!=ki&&(0,r(d[5]).warnOnce)('accessibilityRequired',"accessibilityRequired is deprecated. Use aria-required.");var Je=null!=gi?gi:ki;null!=Je&&(ye['aria-required']=Je,'input'!==l&&'select'!==l&&'textarea'!==l||(ye.required=ki)),null!=Bi&&(0,r(d[5]).warnOnce)('accessibilityRole',"accessibilityRole is deprecated. Use role."),null!=ve&&(ye.role='none'===ve?'presentation':ve),null!=Ti&&(0,r(d[5]).warnOnce)('accessibilityRoleDescription',"accessibilityRoleDescription is deprecated. Use aria-roledescription.");var Qe=null!=qi?qi:Ti;null!=Qe&&(ye['aria-roledescription']=Qe),null!=Hi&&(0,r(d[5]).warnOnce)('accessibilityRowCount',"accessibilityRowCount is deprecated. Use aria-rowcount.");var We=null!=zi?zi:Hi;null!=We&&(ye['aria-rowcount']=We),null!=Fi&&(0,r(d[5]).warnOnce)('accessibilityRowIndex',"accessibilityRowIndex is deprecated. Use aria-rowindex.");var Xe=null!=Ni?Ni:Fi;null!=Xe&&(ye['aria-rowindex']=Xe),null!=_i&&(0,r(d[5]).warnOnce)('accessibilityRowSpan',"accessibilityRowSpan is deprecated. Use aria-rowspan.");var Ye=null!=Ki?Ki:_i;null!=Ye&&(ye['aria-rowspan']=Ye),null!=Zi&&(0,r(d[5]).warnOnce)('accessibilitySelected',"accessibilitySelected is deprecated. Use aria-selected.");var $e=null!=ji?ji:Zi;null!=$e&&(ye['aria-selected']=$e),null!=Ji&&(0,r(d[5]).warnOnce)('accessibilitySetSize',"accessibilitySetSize is deprecated. Use aria-setsize.");var ia=null!=Gi?Gi:Ji;null!=ia&&(ye['aria-setsize']=ia),null!=Wi&&(0,r(d[5]).warnOnce)('accessibilitySort',"accessibilitySort is deprecated. Use aria-sort.");var ea=null!=Qi?Qi:Wi;null!=ea&&(ye['aria-sort']=ea),null!=Yi&&(0,r(d[5]).warnOnce)('accessibilityValueMax',"accessibilityValueMax is deprecated. Use aria-valuemax.");var aa=null!=Xi?Xi:Yi;null!=aa&&(ye['aria-valuemax']=aa),null!=ie&&(0,r(d[5]).warnOnce)('accessibilityValueMin',"accessibilityValueMin is deprecated. Use aria-valuemin.");var la=null!=$i?$i:ie;null!=la&&(ye['aria-valuemin']=la),null!=ae&&(0,r(d[5]).warnOnce)('accessibilityValueNow',"accessibilityValueNow is deprecated. Use aria-valuenow.");var sa=null!=ee?ee:ae;null!=sa&&(ye['aria-valuenow']=sa),null!=se&&(0,r(d[5]).warnOnce)('accessibilityValueText',"accessibilityValueText is deprecated. Use aria-valuetext.");var ca=null!=le?le:se;if(null!=ca&&(ye['aria-valuetext']=ca),null!=ce)for(var ta in ce)if(b.call(ce,ta)){var ra=ta.replace(p,v),na=ce[ta];null!=na&&(ye["data-"+ra]=na)}0===oe||'0'===oe||-1===oe||'-1'===oe?ye.tabIndex=oe:(null!=te&&(0,r(d[5]).warnOnce)('focusable',"focusable is deprecated."),!1===te&&(ye.tabIndex='-1'),'a'===l||'button'===l||'input'===l||'select'===l||'textarea'===l?!1!==te&&!0!==G||(ye.tabIndex='-1'):'button'===ve||'checkbox'===ve||'link'===ve||'radio'===ve||'textbox'===ve||'switch'===ve?!1!==te&&(ye.tabIndex='0'):!0===te&&(ye.tabIndex='0')),null!=ue&&(0,r(d[5]).warnOnce)('pointerEvents',"props.pointerEvents is deprecated. Use style.pointerEvents");var ua=(0,n.default)([de,ue&&O[ue]],(0,s.default)({writingDirection:'ltr'},x)),da=ua[0],oa=ua[1];da&&(ye.className=da),oa&&(ye.style=oa),null!=ne&&(0,r(d[5]).warnOnce)('nativeID',"nativeID is deprecated. Use id.");var ba=null!=re?re:ne;return null!=ba&&(ye.id=ba),null!=be&&(ye['data-testid']=be),null==ye.type&&'button'===l&&(ye.type='button'),ye}}),10,[1,11,16,6,17,32]); +__d((function(g,_r,i,a,m,_e,d){function e(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,o)}return r}m.exports=function(t){for(var r=1;r-1?o=v(f,n.split('$raw')[0]):('production'!==process.env.NODE_ENV&&((0,r(d[9]).validate)(f),t[n]=Object.freeze(f)),a=f,i=(0,r(d[8]).atomic)((0,r(d[7]).preprocess)(a,u)),c=i[0],s(i[1]),o=c),l.set(f,o))})),t}function y(){for(var t=arguments.length,n=new Array(t),o=0;o2){var a=Array.prototype.slice.call(arguments).map((function(t){return y(t)}));throw new Error("StyleSheet.compose() only accepts 2 arguments, received "+o+": "+JSON.stringify(a))}console.warn('StyleSheet.compose(a, b) is deprecated; use array syntax, i.e., [a,b].')}return[t,n]},h.flatten=y,h.getSheet=function(){return{id:c.id,textContent:c.getTextContent()}},h.hairlineWidth=1,a.default&&window.__REACT_DEVTOOLS_GLOBAL_HOOK__&&(window.__REACT_DEVTOOLS_GLOBAL_HOOK__.resolveRNStyle=h.flatten);var w=h;e.default=w}),17,[1,11,16,18,19,22,23,25,33,76]); +__d((function(g,r,i,a,m,e,d){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=!('undefined'==typeof window||!window.document||!window.document.createElement);e.default=n}),18,[]); +__d((function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.createSheet=function(t,h){void 0===h&&(h=s);var b;if(n.default){var p=null!=t?t.getRootNode():document;if(0===c.length)b=(0,o.default)((0,u.default)(h)),f.forEach((function(t){b.insert(t,0)})),l.set(p,c.length),c.push(b);else{var v=l.get(p);if(null==v){var k=c[0],w=null!=k?k.getTextContent():'';b=(0,o.default)((0,u.default)(h,p,w)),l.set(p,c.length),c.push(b)}else b=c[v]}}else 0===c.length?(b=(0,o.default)((0,u.default)(h)),f.forEach((function(t){b.insert(t,0)})),c.push(b)):b=c[0];return{getTextContent:function(){return b.getTextContent()},id:h,insert:function(t,n){c.forEach((function(u){u.insert(t,n)}))}}};var n=t(r(d[1])),u=t(r(d[2])),o=t(r(d[3])),s='react-native-stylesheet',l=new WeakMap,c=[],f=['html{-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:rgba(0,0,0,0);}','body{margin:0;}','button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0;}','input::-webkit-search-cancel-button,input::-webkit-search-decoration,input::-webkit-search-results-button,input::-webkit-search-results-decoration{display:none;}']}),19,[1,18,20,21]); +__d((function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,l,o){if(n.default){var u=null!=l?l:document,f=u.getElementById(t);if(null==f)if((f=document.createElement('style')).setAttribute('id',t),'string'==typeof o&&f.appendChild(document.createTextNode(o)),u instanceof ShadowRoot)u.insertBefore(f,u.firstChild);else{var s=u.head;s&&s.insertBefore(f,s.firstChild)}return f.sheet}return null};var n=t(r(d[1]))}),20,[1,18]); +__d((function(g,r,_i,_a,m,_e,d){Object.defineProperty(_e,"__esModule",{value:!0}),_e.default=function(e){var s,o={},c={};null!=e&&t.call(e.cssRules).forEach((function(t,n){var e=t.cssText;if(e.indexOf('stylesheet-group')>-1)s=u(t),o[s]={start:n,rules:[e]};else{var l=a(e);null!=l&&(c[l]=!0,o[s].rules.push(e))}}));function f(t,n,e){var u=l(o),s=u.indexOf(n)+1,a=u[s],c=null!=a&&null!=o[a].start?o[a].start:t.cssRules.length,f=i(t,e,c);if(f){null==o[n].start&&(o[n].start=c);for(var v=s;vn?1:-1}))}var s=/\s*([,])\s*/g;function a(t){var n=t.split('{')[0].trim();return''!==n?n.replace(s,'$1'):null}function i(t,n,e){try{return t.insertRule(n,e),!0}catch(t){return!1}}}),21,[]); +__d((function(g,r,_i2,a,m,e,d){'use strict';Object.defineProperty(e,"__esModule",{value:!0}),e.styleq=void 0;var l=new WeakMap;function n(n){var s,u,t;return null!=n&&(s=!0===n.disableCache,u=!0===n.disableMix,t=n.transform),function(){for(var n=[],i='',o=null,f=s?null:l,v=new Array(arguments.length),c=0;c0;){var p=v.pop();if(null!=p&&!1!==p)if(Array.isArray(p))for(var y=0;y0&&((0,r(d[3]).warnOnce)('fontVariant','"fontVariant" style array value is deprecated. Use space-separated values.'),I=I.join(' ')),s[R]=I):'textAlignVertical'===R?((0,r(d[3]).warnOnce)('textAlignVertical','"textAlignVertical" style is deprecated. Use "verticalAlign".'),null==o.verticalAlign&&(s.verticalAlign='center'===I?'middle':I)):'transform'===R?(Array.isArray(I)&&(I=w(I)),s.transform=I):s[R]=I)}return s};e.default=p}),25,[1,26,30,32]); +__d((function(_g,_r,i,_a,m,e,d){var t=_r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var u=t(_r(d[1])),f=t(_r(d[2]));e.default=function(t,r){if(void 0===r&&(r=1),null!=t){if('string'==typeof t&&(0,u.default)(t))return t;var l=(0,f.default)(t);if(null!=l)return"rgba("+(l>>16&255)+","+(l>>8&255)+","+(255&l)+","+((l>>24&255)/255*r).toFixed(2)+")"}}}),26,[1,27,28]); +__d((function(g,r,i,a,m,e,d){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;e.default=function(n){return'currentcolor'===n||'currentColor'===n||'inherit'===n||0===n.indexOf('var(')}}),27,[]); +__d((function(g,r,i,a,m,e,d){var u=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var l=u(r(d[1]));e.default=function(u){if(null==u)return u;var n=(0,l.default)(u);return null!=n?n=(n<<24|n>>>8)>>>0:void 0}}),28,[1,29]); +__d((function(_g,_r,i,a,m,e,d){'use strict';function r(r,n,t){return t<0&&(t+=1),t>1&&(t-=1),t<.16666666666666666?r+6*(n-r)*t:t<.5?n:t<.6666666666666666?r+(n-r)*(.6666666666666666-t)*6:r}function n(n,t,u){var s=u<.5?u*(1+t):u+t-u*t,c=2*u-s,l=r(c,s,n+.3333333333333333),o=r(c,s,n),g=r(c,s,n-.3333333333333333);return Math.round(255*l)<<24|Math.round(255*o)<<16|Math.round(255*g)<<8}function t(n,t,u){if(t+u>=1){var s=Math.round(255*t/(t+u));return s<<24|s<<16|s<<8}var c=r(0,1,n+.3333333333333333)*(1-t-u)+t,l=r(0,1,n)*(1-t-u)+t,o=r(0,1,n-.3333333333333333)*(1-t-u)+t;return Math.round(255*c)<<24|Math.round(255*l)<<16|Math.round(255*o)<<8}var u,s='[-+]?\\d*\\.?\\d+',c="[-+]?\\d*\\.?\\d+%";function l(){for(var r=arguments.length,n=new Array(r),t=0;t255?255:n}function f(r){return(parseFloat(r)%360+360)%360/360}function p(r){var n=parseFloat(r);return n<0?0:n>1?255:Math.round(255*n)}function y(r){var n=parseFloat(r);return n<0?0:n>100?1:n/100}function w(r){switch(r){case'transparent':return 0;case'aliceblue':return 4042850303;case'antiquewhite':return 4209760255;case'aqua':case'cyan':return 16777215;case'aquamarine':return 2147472639;case'azure':return 4043309055;case'beige':return 4126530815;case'bisque':return 4293182719;case'black':return 255;case'blanchedalmond':return 4293643775;case'blue':return 65535;case'blueviolet':return 2318131967;case'brown':return 2771004159;case'burlywood':return 3736635391;case'burntsienna':return 3934150143;case'cadetblue':return 1604231423;case'chartreuse':return 2147418367;case'chocolate':return 3530104575;case'coral':return 4286533887;case'cornflowerblue':return 1687547391;case'cornsilk':return 4294499583;case'crimson':return 3692313855;case'darkblue':return 35839;case'darkcyan':return 9145343;case'darkgoldenrod':return 3095792639;case'darkgray':case'darkgrey':return 2846468607;case'darkgreen':return 6553855;case'darkkhaki':return 3182914559;case'darkmagenta':return 2332068863;case'darkolivegreen':return 1433087999;case'darkorange':return 4287365375;case'darkorchid':return 2570243327;case'darkred':return 2332033279;case'darksalmon':return 3918953215;case'darkseagreen':return 2411499519;case'darkslateblue':return 1211993087;case'darkslategray':case'darkslategrey':return 793726975;case'darkturquoise':return 13554175;case'darkviolet':return 2483082239;case'deeppink':return 4279538687;case'deepskyblue':return 12582911;case'dimgray':case'dimgrey':return 1768516095;case'dodgerblue':return 512819199;case'firebrick':return 2988581631;case'floralwhite':return 4294635775;case'forestgreen':return 579543807;case'fuchsia':case'magenta':return 4278255615;case'gainsboro':return 3705462015;case'ghostwhite':return 4177068031;case'gold':return 4292280575;case'goldenrod':return 3668254975;case'gray':case'grey':return 2155905279;case'green':return 8388863;case'greenyellow':return 2919182335;case'honeydew':return 4043305215;case'hotpink':return 4285117695;case'indianred':return 3445382399;case'indigo':return 1258324735;case'ivory':return 4294963455;case'khaki':return 4041641215;case'lavender':return 3873897215;case'lavenderblush':return 4293981695;case'lawngreen':return 2096890111;case'lemonchiffon':return 4294626815;case'lightblue':return 2916673279;case'lightcoral':return 4034953471;case'lightcyan':return 3774873599;case'lightgoldenrodyellow':return 4210742015;case'lightgray':case'lightgrey':return 3553874943;case'lightgreen':return 2431553791;case'lightpink':return 4290167295;case'lightsalmon':return 4288707327;case'lightseagreen':return 548580095;case'lightskyblue':return 2278488831;case'lightslategray':case'lightslategrey':return 2005441023;case'lightsteelblue':return 2965692159;case'lightyellow':return 4294959359;case'lime':return 16711935;case'limegreen':return 852308735;case'linen':return 4210091775;case'maroon':return 2147483903;case'mediumaquamarine':return 1724754687;case'mediumblue':return 52735;case'mediumorchid':return 3126187007;case'mediumpurple':return 2473647103;case'mediumseagreen':return 1018393087;case'mediumslateblue':return 2070474495;case'mediumspringgreen':return 16423679;case'mediumturquoise':return 1221709055;case'mediumvioletred':return 3340076543;case'midnightblue':return 421097727;case'mintcream':return 4127193855;case'mistyrose':return 4293190143;case'moccasin':return 4293178879;case'navajowhite':return 4292783615;case'navy':return 33023;case'oldlace':return 4260751103;case'olive':return 2155872511;case'olivedrab':return 1804477439;case'orange':return 4289003775;case'orangered':return 4282712319;case'orchid':return 3664828159;case'palegoldenrod':return 4008225535;case'palegreen':return 2566625535;case'paleturquoise':return 2951671551;case'palevioletred':return 3681588223;case'papayawhip':return 4293907967;case'peachpuff':return 4292524543;case'peru':return 3448061951;case'pink':return 4290825215;case'plum':return 3718307327;case'powderblue':return 2967529215;case'purple':return 2147516671;case'rebeccapurple':return 1714657791;case'red':return 4278190335;case'rosybrown':return 3163525119;case'royalblue':return 1097458175;case'saddlebrown':return 2336560127;case'salmon':return 4202722047;case'sandybrown':return 4104413439;case'seagreen':return 780883967;case'seashell':return 4294307583;case'sienna':return 2689740287;case'silver':return 3233857791;case'skyblue':return 2278484991;case'slateblue':return 1784335871;case'slategray':case'slategrey':return 1887473919;case'snow':return 4294638335;case'springgreen':return 16744447;case'steelblue':return 1182971135;case'tan':return 3535047935;case'teal':return 8421631;case'thistle':return 3636451583;case'tomato':return 4284696575;case'turquoise':return 1088475391;case'violet':return 4001558271;case'wheat':return 4125012991;case'white':return 4294967295;case'whitesmoke':return 4126537215;case'yellow':return 4294902015;case'yellowgreen':return 2597139199}return null}m.exports=function(r){if('number'==typeof r)return r>>>0===r&&r>=0&&r<=4294967295?r:null;if('string'!=typeof r)return null;var u,s=h();if(u=s.hex6.exec(r))return parseInt(u[1]+'ff',16)>>>0;var c=w(r);return null!=c?c:(u=s.rgb.exec(r))?(b(u[1])<<24|b(u[2])<<16|b(u[3])<<8|255)>>>0:(u=s.rgba.exec(r))?void 0!==u[6]?(b(u[6])<<24|b(u[7])<<16|b(u[8])<<8|p(u[9]))>>>0:(b(u[2])<<24|b(u[3])<<16|b(u[4])<<8|p(u[5]))>>>0:(u=s.hex3.exec(r))?parseInt(u[1]+u[1]+u[2]+u[2]+u[3]+u[3]+'ff',16)>>>0:(u=s.hex8.exec(r))?parseInt(u[1],16)>>>0:(u=s.hex4.exec(r))?parseInt(u[1]+u[1]+u[2]+u[2]+u[3]+u[3]+u[4]+u[4],16)>>>0:(u=s.hsl.exec(r))?(255|n(f(u[1]),y(u[2]),y(u[3])))>>>0:(u=s.hsla.exec(r))?void 0!==u[6]?(n(f(u[6]),y(u[7]),y(u[8]))|p(u[9]))>>>0:(n(f(u[2]),y(u[3]),y(u[4]))|p(u[5]))>>>0:(u=s.hwb.exec(r))?(255|t(f(u[1]),y(u[2]),y(u[3])))>>>0:null}}),29,[]); +__d((function(g,r,i,a,m,e,d){var o=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(o,n){var C=o;null!=n&&l.default[n]||'number'!=typeof o?null!=n&&u[n]&&(C=(0,t.default)(o)):C=o+"px";return C};var l=o(r(d[1])),t=o(r(d[2])),u={backgroundColor:!0,borderColor:!0,borderTopColor:!0,borderRightColor:!0,borderBottomColor:!0,borderLeftColor:!0,color:!0,shadowColor:!0,textDecorationColor:!0,textShadowColor:!0}}),30,[1,31,26]); +__d((function(g,r,i,a,m,e,d){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var o={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,flex:!0,flexGrow:!0,flexOrder:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,fontWeight:!0,gridRow:!0,gridRowEnd:!0,gridRowGap:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnGap:!0,gridColumnStart:!0,lineClamp:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0,scale:!0,scaleX:!0,scaleY:!0,scaleZ:!0,shadowOpacity:!0},t=['ms','Moz','O','Webkit'],l=function(o,t){return o+t.charAt(0).toUpperCase()+t.substring(1)};Object.keys(o).forEach((function(n){t.forEach((function(t){o[l(t,n)]=o[n]}))}));e.default=o}),31,[]); +__d((function(g,r,i,a,m,e,d){Object.defineProperty(e,"__esModule",{value:!0}),e.warnOnce=function(o,c){if('production'!==process.env.NODE_ENV){if(n[o])return;console.warn(c),n[o]=!0}};var n={}}),32,[]); +__d((function(g,r,_i,a,m,e,d){var n=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.atomic=function(n){var t={$$css:!0},o=[];function l(n,t,i){var l,u=M(i,t),f=t+u,s=v.get(f);if(null!=s)l=s[0],o.push(s[1]);else{l=q('r',n,n!==t?f:u);var c=I[n]||E,p=[V(l,t,i),c];o.push(p),v.set(f,[l,p])}return l}return Object.keys(n).sort().forEach((function(o){var u=n[o];if(null!=u){var f;if(z.indexOf(o)>-1){var s=l(o,o,'left'),c=l(o,o,'right');'start'===u?f=[s,c]:'end'===u&&(f=[c,s])}var p=T[o];if(null!=p){var b=l(o,p,u),h=l(o,K[p],u);f=[b,h]}if('transitionProperty'===o){for(var v=Array.isArray(u)?u:[u],y=[],S=0;S0){var I=(0,i.default)(v),k=(0,i.default)(v);y.forEach((function(n){var t=I[n];if('string'==typeof t){var i=T[t],u=K[i];I[n]=i,k[n]=u;var s=l(o,o,I),c=l(o,o,k);f=[s,c]}}))}}null==f?f=l(o,o,u):t.$$css$localize=!0,t[o]=f}})),[t,o]},e.classic=function(n,t){var o,f={$$css:!0},s=[],c=n.animationKeyframes,p=(0,u.default)(n,h),b=q('css',t,JSON.stringify(n)),v="."+b;if(null!=c){var y=G(c),E=y[0],I=y[1];o=E.join(','),s.push.apply(s,(0,i.default)(I))}var k=D((0,l.default)((0,l.default)({},p),{},{animationName:o}));return s.push(""+v+k),f[b]=b,[f,[[s,S]]]},e.inline=function(n,t){var i=n||y,o={},l={},u=function(){var n=i[s],u=s,f=n;if(!Object.prototype.hasOwnProperty.call(i,s)||null==n)return"continue";z.indexOf(s)>-1&&('start'===n?f=t?'right':'left':'end'===n&&(f=t?'left':'right'));var c=T[s];if(null!=c&&(u=t?K[c]:c),'transitionProperty'===s){var p=Array.isArray(n)?n:[n];p.forEach((function(n,i){if('string'==typeof n){var o=T[n];null!=o&&(p[i]=t?K[o]:o,f=p.join(' '))}}))}o[u]||(l[u]=f),u===s&&(o[u]=!0)};for(var s in i)u();return(0,f.default)(l,!0)},e.stringifyValueWithProperty=M;var t,i=n(r(d[1])),o=n(r(d[2])),l=n(r(d[3])),u=n(r(d[4])),f=n(r(d[5])),s=n(r(d[6])),c=n(r(d[7])),p=n(r(d[8])),b=n(r(d[9])),h=["animationKeyframes"],v=new Map,y={},S=1,E=3,I={borderColor:2,borderRadius:2,borderStyle:2,borderWidth:2,display:2,flex:2,inset:2,margin:2,overflow:2,overscrollBehavior:2,padding:2,insetBlock:2.1,insetInline:2.1,marginInline:2.1,marginBlock:2.1,paddingInline:2.1,paddingBlock:2.1,borderBlockStartColor:2.2,borderBlockStartStyle:2.2,borderBlockStartWidth:2.2,borderBlockEndColor:2.2,borderBlockEndStyle:2.2,borderBlockEndWidth:2.2,borderInlineStartColor:2.2,borderInlineStartStyle:2.2,borderInlineStartWidth:2.2,borderInlineEndColor:2.2,borderInlineEndStyle:2.2,borderInlineEndWidth:2.2,borderEndStartRadius:2.2,borderEndEndRadius:2.2,borderStartStartRadius:2.2,borderStartEndRadius:2.2,insetBlockEnd:2.2,insetBlockStart:2.2,insetInlineEnd:2.2,insetInlineStart:2.2,marginBlockStart:2.2,marginBlockEnd:2.2,marginInlineStart:2.2,marginInlineEnd:2.2,paddingBlockStart:2.2,paddingBlockEnd:2.2,paddingInlineStart:2.2,paddingInlineEnd:2.2},k='borderTopLeftRadius',R='borderTopRightRadius',B='borderBottomLeftRadius',O='borderBottomRightRadius',W='borderLeftColor',j='borderLeftStyle',C='borderLeftWidth',w='borderRightColor',x='borderRightStyle',A='borderRightWidth',L='right',N='marginLeft',$='marginRight',P='paddingLeft',_='paddingRight',J='left',K=(t={},(0,o.default)((0,o.default)((0,o.default)((0,o.default)((0,o.default)((0,o.default)((0,o.default)((0,o.default)((0,o.default)((0,o.default)(t,k,R),R,k),B,O),O,B),W,w),j,x),C,A),w,W),x,j),A,C),(0,o.default)((0,o.default)((0,o.default)((0,o.default)((0,o.default)((0,o.default)(t,J,L),N,$),$,N),P,_),_,P),L,J)),T={borderStartStartRadius:k,borderStartEndRadius:R,borderEndStartRadius:B,borderEndEndRadius:O,borderInlineStartColor:W,borderInlineStartStyle:j,borderInlineStartWidth:C,borderInlineEndColor:w,borderInlineEndStyle:x,borderInlineEndWidth:A,insetInlineEnd:L,insetInlineStart:J,marginInlineStart:N,marginInlineEnd:$,paddingInlineStart:P,paddingInlineEnd:_},z=['clear','float','textAlign'];function M(n,t){var i=(0,p.default)(n,t);return'string'!=typeof i?JSON.stringify(i||''):i}function V(n,t,l){var u=[],f="."+n;switch(t){case'animationKeyframes':var s=G(l),c=s[0],p=s[1],b=D({animationName:c.join(',')});u.push.apply(u,[""+f+b].concat((0,i.default)(p)));break;case'placeholderTextColor':var h=D({color:l,opacity:1});u.push(f+"::-webkit-input-placeholder"+h,f+"::-moz-placeholder"+h,f+":-ms-input-placeholder"+h,f+"::placeholder"+h);break;case'pointerEvents':var v=l;if('auto'===l||'box-only'===l){if(v='auto!important','box-only'===l){var y=D({pointerEvents:'none'});u.push(f+">*"+y)}}else if(('none'===l||'box-none'===l)&&(v='none!important','box-none'===l)){var S=D({pointerEvents:'auto'});u.push(f+">*"+S)}var E=D({pointerEvents:v});u.push(""+f+E);break;case'scrollbarWidth':'none'===l&&u.push(f+"::-webkit-scrollbar{display:none}");var I=D({scrollbarWidth:l});u.push(""+f+I);break;default:var k=D((0,o.default)({},t,l));u.push(""+f+k)}return u}function D(n){var t=(0,b.default)((0,f.default)(n));return"{"+Object.keys(t).map((function(n){var i=t[n],o=(0,c.default)(n);return Array.isArray(i)?i.map((function(n){return o+":"+n})).join(';'):o+":"+i})).sort().join(';')+";}"}function q(n,t,i){var o=(0,s.default)(t+i);return'production'!==process.env.NODE_ENV?n+"-"+t+"-"+o:n+"-"+o}function F(n){var t=q('r','animation',JSON.stringify(n)),i='{'+Object.keys(n).map((function(t){return""+t+D(n[t])})).join('')+'}',o=['-webkit-',''].map((function(n){return"@"+n+"keyframes "+t+i}));return[t,o]}function G(n){if('number'==typeof n)throw new Error("Invalid CSS keyframes type: "+typeof n);var t=[],o=[];return(Array.isArray(n)?n:[n]).forEach((function(n){if('string'==typeof n)t.push(n);else{var l=F(n),u=l[0],f=l[1];t.push(u),o.push.apply(o,(0,i.default)(f))}})),[t,o]}}),33,[1,34,12,11,16,40,41,42,30,43]); +__d((function(g,_r,i,a,m,e,d){m.exports=function(t){return _r(d[0])(t)||_r(d[1])(t)||_r(d[2])(t)||_r(d[3])()},m.exports.__esModule=!0,m.exports.default=m.exports}),34,[35,37,38,39]); +__d((function(g,_r,i,a,m,e,d){m.exports=function(r){if(Array.isArray(r))return _r(d[0])(r)},m.exports.__esModule=!0,m.exports.default=m.exports}),35,[36]); +__d((function(g,_r,i,_a,m,_e,d){m.exports=function(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=Array(r);t-1){var f=n.split(/,\s*/);f[f.indexOf('System')]=b,s[c]=f.join(',')}else s[c]='monospace'===n?"monospace,monospace":n;else if('textDecorationLine'===c)l?s.textDecorationLine=n:s.textDecoration=n;else if('writingDirection'===c)s.direction=n;else{var B=(0,t.default)(o[c],c),u=p[c];i&&'inset'===c?(null==o.insetInline&&(s.left=B,s.right=B),null==o.insetBlock&&(s.top=B,s.bottom=B)):i&&'margin'===c?(null==o.marginInline&&(s.marginLeft=B,s.marginRight=B),null==o.marginBlock&&(s.marginTop=B,s.marginBottom=B)):i&&'padding'===c?(null==o.paddingInline&&(s.paddingLeft=B,s.paddingRight=B),null==o.paddingBlock&&(s.paddingTop=B,s.paddingBottom=B)):u?u.forEach((function(t,i){null==o[t]&&(s[t]=B)})):s[c]=B}};for(var c in o)f();return s}}),40,[1,30,18]); +__d((function(g,r,_i,a,m,e,d){function t(t,c){for(var o,n=t.length,h=c^n,u=0;n>=4;)o=1540483477*(65535&(o=255&t.charCodeAt(u)|(255&t.charCodeAt(++u))<<8|(255&t.charCodeAt(++u))<<16|(255&t.charCodeAt(++u))<<24))+((1540483477*(o>>>16)&65535)<<16),h=1540483477*(65535&h)+((1540483477*(h>>>16)&65535)<<16)^(o=1540483477*(65535&(o^=o>>>24))+((1540483477*(o>>>16)&65535)<<16)),n-=4,++u;switch(n){case 3:h^=(255&t.charCodeAt(u+2))<<16;case 2:h^=(255&t.charCodeAt(u+1))<<8;case 1:h=1540483477*(65535&(h^=255&t.charCodeAt(u)))+((1540483477*(h>>>16)&65535)<<16)}return h=1540483477*(65535&(h^=h>>>13))+((1540483477*(h>>>16)&65535)<<16),(h^=h>>>15)>>>0}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;e.default=function(c){return t(c,1).toString(36)}}),41,[]); +__d((function(g,r,i,a,m,e,d){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=/[A-Z]/g,n=/^ms-/,u={};function o(t){return'-'+t.toLowerCase()}e.default=function(f){if(f in u)return u[f];var c=f.replace(t,o);return u[f]=n.test(c)?'-'+c:c}}),42,[]); +__d((function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var u=t(r(d[1])),f=t(r(d[2])),l=(0,u.default)(f.default);e.default=l}),43,[1,44,50]); +__d((function(g,r,_i,a,m,e,d){'use strict';Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(l){var i=l.prefixMap,o=l.plugins;return function l(s){for(var v in s){var c=s[v];if((0,n.default)(c))s[v]=l(c);else if(Array.isArray(c)){for(var _=[],p=0,y=c.length;p0&&(s[v]=_)}else{var h=(0,u.default)(o,v,c,s,i);h&&(s[v]=h),s=(0,t.default)(i,v,s)}}return s}};var t=l(r(d[0])),u=l(r(d[1])),f=l(r(d[2])),n=l(r(d[3]));function l(t){return t&&t.__esModule?t:{default:t}}}),44,[45,47,48,49]); +__d((function(g,r,_i,a,m,e,d){'use strict';Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,f,n){var l=t[f];if(l&&n.hasOwnProperty(f))for(var o=(0,u.default)(f),_=0;_t.length)&&(n=t.length);for(var o=0,i=new Array(n);o-1)return n.map((function(t){return f.replace(/image-set\(/g,t+'image-set(')}))};var t,u=(t=r(d[0]))&&t.__esModule?t:{default:t};var n=['-webkit-','']}),69,[70]); +__d((function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(n){return'string'==typeof n&&t.test(n)};var t=/-webkit-|-moz-|-ms-/}),70,[]); +__d((function(g,r,_i,a,m,e,d){'use strict';Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(o,n,i){if(Object.prototype.hasOwnProperty.call(t,o))for(var l=t[o],b=0,B=l.length;b-1)return p;var v=l.split(/,(?![^()]*(?:\([^()]*\))?\))/g).filter((function(t){return!/-webkit-|-ms-/.test(t)})).join(',');return t.indexOf('Moz')>-1?v:(o['Webkit'+(0,n.default)(t)]=p,o['Moz'+(0,n.default)(t)]=v,l)}};var t=o(r(d[0])),i=o(r(d[1])),n=o(r(d[2]));function o(t){return t&&t.__esModule?t:{default:t}}var f={transition:!0,transitionProperty:!0,WebkitTransition:!0,WebkitTransitionProperty:!0,MozTransition:!0,MozTransitionProperty:!0},u={Webkit:'-webkit-',Moz:'-moz-',ms:'-ms-'};function s(n,o){if((0,i.default)(n))return n;for(var f=n.split(/,(?![^()]*(?:\([^()]*\))?\))/g),s=0,l=f.length;s-1&&'order'!==b)for(var k=o[c],z=0,M=k.length;z-1)s("Invalid style declaration \""+c+":"+f+"\". Values cannot include \"!important\""),p=!0;else{var v='';'animation'===c||'animationName'===c?(v='Did you mean "animationKeyframes"?',p=!0):'direction'===c?(v='Did you mean "writingDirection"?',p=!0):t[c]?(v='Please use long-form properties.',p=!0):l[c]&&'string'==typeof f&&(0,o.default)(f).nodes.length>1&&(v="Value is \""+f+"\" but only single values are supported.",p=!0),''!==v&&s("Invalid style property of \""+c+"\". "+v)}p&&delete n[u]}}};var o=n(r(d[1])),t={background:!0,borderBottom:!0,borderLeft:!0,borderRight:!0,borderTop:!0,font:!0,grid:!0,outline:!0,textDecoration:!0},l={flex:!0,margin:!0,padding:!0,borderColor:!0,borderRadius:!0,borderStyle:!0,borderWidth:!0,inset:!0,insetBlock:!0,insetInline:!0,marginBlock:!0,marginInline:!0,marginHorizontal:!0,marginVertical:!0,paddingBlock:!0,paddingInline:!0,paddingHorizontal:!0,paddingVertical:!0,overflow:!0,overscrollBehavior:!0,backgroundPosition:!0};function s(n){console.error(n)}}),76,[1,77]); +__d((function(g,r,i,a,m,e,d){function t(n){return this instanceof t?(this.nodes=r(d[0])(n),this):new t(n)}t.prototype.toString=function(){return Array.isArray(this.nodes)?r(d[1])(this.nodes):""},t.prototype.walk=function(t,n){return r(d[2])(this.nodes,t,n),this},t.unit=r(d[3]),t.walk=r(d[2]),t.stringify=r(d[1]),m.exports=t}),77,[78,79,80,81]); +__d((function(g,r,i,a,m,e,d){var o="(".charCodeAt(0),n=")".charCodeAt(0),c="'".charCodeAt(0),t='"'.charCodeAt(0),s="\\".charCodeAt(0),u="/".charCodeAt(0),l=",".charCodeAt(0),h=":".charCodeAt(0),f="*".charCodeAt(0),p="u".charCodeAt(0),x="U".charCodeAt(0),A="+".charCodeAt(0),C=/^[a-f0-9?-]+$/i;m.exports=function(I){for(var v,E,y,w,O,b,_,q,U,$=[],j=I,k=0,z=j.charCodeAt(k),B=j.length,D=[{nodes:$}],F=0,G="",H="",J="";k=48&&A<=57)return!0;var n=h.charCodeAt(2);return A===c&&n>=48&&n<=57}return C===c?(A=h.charCodeAt(1))>=48&&A<=57:C>=48&&C<=57}m.exports=function(n){var f,u,v,l=0,s=n.length;if(0===s||!C(n))return!1;for((f=n.charCodeAt(l))!==o&&f!==t||l++;l57);)l+=1;if(f=n.charCodeAt(l),u=n.charCodeAt(l+1),f===c&&u>=48&&u<=57)for(l+=2;l57);)l+=1;if(f=n.charCodeAt(l),u=n.charCodeAt(l+1),v=n.charCodeAt(l+2),(f===h||f===A)&&(u>=48&&u<=57||(u===o||u===t)&&v>=48&&v<=57))for(l+=u===o||u===t?3:2;l57);)l+=1;return{number:n.slice(0,l),unit:n.slice(l)}}}),81,[]); +__d((function(g,r,i,a,m,e,d){'use strict';'production'===process.env.NODE_ENV?m.exports=r(d[0]):m.exports=r(d[1])}),82,[83,84]); __d((function(_g,_r,i,_a,_m,_e,_d){ /** * @license React - * react-dom.production.min.js + * react.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ -'use strict';var e=_r(_d[0]);function n(e){for(var n="https://reactjs.org/docs/error-decoder.html?invariant="+e,t=1;tn}return!1}function h(e,n,t,r,l,a,u){this.acceptsBooleans=2===n||3===n||4===n,this.attributeName=r,this.attributeNamespace=l,this.mustUseProperty=t,this.propertyName=e,this.type=n,this.sanitizeURL=a,this.removeEmptyString=u}var g={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach((function(e){g[e]=new h(e,0,!1,e,null,!1,!1)})),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach((function(e){var n=e[0];g[n]=new h(n,1,!1,e[1],null,!1,!1)})),["contentEditable","draggable","spellCheck","value"].forEach((function(e){g[e]=new h(e,2,!1,e.toLowerCase(),null,!1,!1)})),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach((function(e){g[e]=new h(e,2,!1,e,null,!1,!1)})),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach((function(e){g[e]=new h(e,3,!1,e.toLowerCase(),null,!1,!1)})),["checked","multiple","muted","selected"].forEach((function(e){g[e]=new h(e,3,!0,e,null,!1,!1)})),["capture","download"].forEach((function(e){g[e]=new h(e,4,!1,e,null,!1,!1)})),["cols","rows","size","span"].forEach((function(e){g[e]=new h(e,6,!1,e,null,!1,!1)})),["rowSpan","start"].forEach((function(e){g[e]=new h(e,5,!1,e.toLowerCase(),null,!1,!1)}));var v=/[\-:]([a-z])/g;function y(e){return e[1].toUpperCase()}function b(e,n,t,r){var l=g.hasOwnProperty(n)?g[n]:null;(null!==l?0!==l.type:r||!(2--o||l[u]!==a[o]){var s="\n"+l[u].replace(" at new "," at ");return e.displayName&&s.includes("")&&(s=s.replace("",e.displayName)),s}}while(1<=u&&0<=o);break}}}finally{V=!1,Error.prepareStackTrace=t}return(e=e?e.displayName||e.name:"")?U(e):""}function B(e){switch(e.tag){case 5:return U(e.type);case 16:return U("Lazy");case 13:return U("Suspense");case 19:return U("SuspenseList");case 0:case 2:case 15:return e=A(e.type,!1);case 11:return e=A(e.type.render,!1);case 1:return e=A(e.type,!0);default:return""}}function H(e){if(null==e)return null;if("function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case x:return"Fragment";case S:return"Portal";case C:return"Profiler";case E:return"StrictMode";case P:return"Suspense";case L:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case z:return(e.displayName||"Context")+".Consumer";case _:return(e._context.displayName||"Context")+".Provider";case N:var n=e.render;return(e=e.displayName)||(e=""!==(e=n.displayName||n.name||"")?"ForwardRef("+e+")":"ForwardRef"),e;case T:return null!==(n=e.displayName||null)?n:H(e.type)||"Memo";case M:n=e._payload,e=e._init;try{return H(e(n))}catch(e){}}return null}function Q(e){var n=e.type;switch(e.tag){case 24:return"Cache";case 9:return(n.displayName||"Context")+".Consumer";case 10:return(n._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=(e=n.render).displayName||e.name||"",n.displayName||(""!==e?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return n;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return H(n);case 8:return n===E?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if("function"==typeof n)return n.displayName||n.name||null;if("string"==typeof n)return n}return null}function W(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":case"object":return e;default:return""}}function j(e){var n=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===n||"radio"===n)}function $(e){var n=j(e)?"checked":"value",t=Object.getOwnPropertyDescriptor(e.constructor.prototype,n),r=""+e[n];if(!e.hasOwnProperty(n)&&void 0!==t&&"function"==typeof t.get&&"function"==typeof t.set){var l=t.get,a=t.set;return Object.defineProperty(e,n,{configurable:!0,get:function(){return l.call(this)},set:function(e){r=""+e,a.call(this,e)}}),Object.defineProperty(e,n,{enumerable:t.enumerable}),{getValue:function(){return r},setValue:function(e){r=""+e},stopTracking:function(){e._valueTracker=null,delete e[n]}}}}function K(e){e._valueTracker||(e._valueTracker=$(e))}function q(e){if(!e)return!1;var n=e._valueTracker;if(!n)return!0;var t=n.getValue(),r="";return e&&(r=j(e)?e.checked?"true":"false":e.value),(e=r)!==t&&(n.setValue(e),!0)}function Y(e){if(void 0===(e=e||("undefined"!=typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(n){return e.body}}function X(e,n){var t=n.checked;return O({},n,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=t?t:e._wrapperState.initialChecked})}function G(e,n){var t=null==n.defaultValue?"":n.defaultValue,r=null!=n.checked?n.checked:n.defaultChecked;t=W(null!=n.value?n.value:t),e._wrapperState={initialChecked:r,initialValue:t,controlled:"checkbox"===n.type||"radio"===n.type?null!=n.checked:null!=n.value}}function Z(e,n){null!=(n=n.checked)&&b(e,"checked",n,!1)}function J(e,n){Z(e,n);var t=W(n.value),r=n.type;if(null!=t)"number"===r?(0===t&&""===e.value||e.value!=t)&&(e.value=""+t):e.value!==""+t&&(e.value=""+t);else if("submit"===r||"reset"===r)return void e.removeAttribute("value");n.hasOwnProperty("value")?ne(e,n.type,t):n.hasOwnProperty("defaultValue")&&ne(e,n.type,W(n.defaultValue)),null==n.checked&&null!=n.defaultChecked&&(e.defaultChecked=!!n.defaultChecked)}function ee(e,n,t){if(n.hasOwnProperty("value")||n.hasOwnProperty("defaultValue")){var r=n.type;if(!("submit"!==r&&"reset"!==r||void 0!==n.value&&null!==n.value))return;n=""+e._wrapperState.initialValue,t||n===e.value||(e.value=n),e.defaultValue=n}""!==(t=e.name)&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,""!==t&&(e.name=t)}function ne(e,n,t){"number"===n&&Y(e.ownerDocument)===e||(null==t?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+t&&(e.defaultValue=""+t))}var te=Array.isArray;function re(e,n,t,r){if(e=e.options,n){n={};for(var l=0;l"+n.valueOf().toString()+"",n=ce.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;n.firstChild;)e.appendChild(n.firstChild)}},"undefined"!=typeof MSApp&&MSApp.execUnsafeLocalFunction?function(e,n,t,r){MSApp.execUnsafeLocalFunction((function(){return fe(e,n)}))}:fe);function pe(e,n){if(n){var t=e.firstChild;if(t&&t===e.lastChild&&3===t.nodeType)return void(t.nodeValue=n)}e.textContent=n}var me={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},he=["Webkit","ms","Moz","O"];function ge(e,n,t){return null==n||"boolean"==typeof n||""===n?"":t||"number"!=typeof n||0===n||me.hasOwnProperty(e)&&me[e]?(""+n).trim():n+"px"}function ve(e,n){for(var t in e=e.style,n)if(n.hasOwnProperty(t)){var r=0===t.indexOf("--"),l=ge(t,n[t],r);"float"===t&&(t="cssFloat"),r?e.setProperty(t,l):e[t]=l}}Object.keys(me).forEach((function(e){he.forEach((function(n){n=n+e.charAt(0).toUpperCase()+e.substring(1),me[n]=me[e]}))}));var ye=O({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function be(e,t){if(t){if(ye[e]&&(null!=t.children||null!=t.dangerouslySetInnerHTML))throw Error(n(137,e));if(null!=t.dangerouslySetInnerHTML){if(null!=t.children)throw Error(n(60));if("object"!=typeof t.dangerouslySetInnerHTML||!("__html"in t.dangerouslySetInnerHTML))throw Error(n(61))}if(null!=t.style&&"object"!=typeof t.style)throw Error(n(62))}}function we(e,n){if(-1===e.indexOf("-"))return"string"==typeof n.is;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var ke=null;function Se(e){return(e=e.target||e.srcElement||window).correspondingUseElement&&(e=e.correspondingUseElement),3===e.nodeType?e.parentNode:e}var xe=null,Ee=null,Ce=null;function ze(e){if(e=bl(e)){if("function"!=typeof xe)throw Error(n(280));var t=e.stateNode;t&&(t=kl(t),xe(e.stateNode,e.type,t))}}function Ne(e){Ee?Ce?Ce.push(e):Ce=[e]:Ee=e}function Pe(){if(Ee){var e=Ee,n=Ce;if(Ce=Ee=null,ze(e),n)for(e=0;e>>=0,0===e?32:31-(nn(e)/tn|0)|0},nn=Math.log,tn=Math.LN2;var rn=64,ln=4194304;function an(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return 4194240&e;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return 130023424&e;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function un(e,n){var t=e.pendingLanes;if(0===t)return 0;var r=0,l=e.suspendedLanes,a=e.pingedLanes,u=268435455&t;if(0!==u){var o=u&~l;0!==o?r=an(o):0!==(a&=u)&&(r=an(a))}else 0!==(u=t&~l)?r=an(u):0!==a&&(r=an(a));if(0===r)return 0;if(0!==n&&n!==r&&!(n&l)&&((l=r&-r)>=(a=n&-n)||16===l&&4194240&a))return n;if(4&r&&(r|=16&t),0!==(n=e.entangledLanes))for(e=e.entanglements,n&=r;0t;t++)n.push(e);return n}function pn(e,n,t){e.pendingLanes|=n,536870912!==n&&(e.suspendedLanes=0,e.pingedLanes=0),(e=e.eventTimes)[n=31-en(n)]=t}function mn(e,n){var t=e.pendingLanes&~n;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=n,e.mutableReadLanes&=n,e.entangledLanes&=n,n=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=Mt),Dt=String.fromCharCode(32),It=!1;function Ot(e,n){switch(e){case"keyup":return-1!==Lt.indexOf(n.keyCode);case"keydown":return 229!==n.keyCode;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ut(e){return"object"==typeof(e=e.detail)&&"data"in e?e.data:null}var Vt=!1;function At(e,n){switch(e){case"compositionend":return Ut(n);case"keypress":return 32!==n.which?null:(It=!0,Dt);case"textInput":return(e=n.data)===Dt&&It?null:e;default:return null}}function Bt(e,n){if(Vt)return"compositionend"===e||!Tt&&Ot(e,n)?(e=Zn(),Gn=Xn=Yn=null,Vt=!1,e):null;switch(e){case"paste":default:return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1=n)return{node:r,offset:n-e};e=t}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=ir(r)}}function cr(e,n){return!(!e||!n)&&(e===n||(!e||3!==e.nodeType)&&(n&&3===n.nodeType?cr(e,n.parentNode):"contains"in e?e.contains(n):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(n))))}function fr(){for(var e=window,n=Y();n instanceof e.HTMLIFrameElement;){try{var t="string"==typeof n.contentWindow.location.href}catch(e){t=!1}if(!t)break;n=Y((e=n.contentWindow).document)}return n}function dr(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n&&("input"===n&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===n||"true"===e.contentEditable)}function pr(e){var n=fr(),t=e.focusedElem,r=e.selectionRange;if(n!==t&&t&&t.ownerDocument&&cr(t.ownerDocument.documentElement,t)){if(null!==r&&dr(t))if(n=r.start,void 0===(e=r.end)&&(e=n),"selectionStart"in t)t.selectionStart=n,t.selectionEnd=Math.min(e,t.value.length);else if((e=(n=t.ownerDocument||document)&&n.defaultView||window).getSelection){e=e.getSelection();var l=t.textContent.length,a=Math.min(r.start,l);r=void 0===r.end?a:Math.min(r.end,l),!e.extend&&a>r&&(l=r,r=a,a=l),l=sr(t,a);var u=sr(t,r);l&&u&&(1!==e.rangeCount||e.anchorNode!==l.node||e.anchorOffset!==l.offset||e.focusNode!==u.node||e.focusOffset!==u.offset)&&((n=n.createRange()).setStart(l.node,l.offset),e.removeAllRanges(),a>r?(e.addRange(n),e.extend(u.node,u.offset)):(n.setEnd(u.node,u.offset),e.addRange(n)))}for(n=[],e=t;e=e.parentNode;)1===e.nodeType&&n.push({element:e,left:e.scrollLeft,top:e.scrollTop});for("function"==typeof t.focus&&t.focus(),t=0;t=document.documentMode,hr=null,gr=null,vr=null,yr=!1;function br(e,n,t){var r=t.window===t?t.document:9===t.nodeType?t:t.ownerDocument;yr||null==hr||hr!==Y(r)||("selectionStart"in(r=hr)&&dr(r)?r={start:r.selectionStart,end:r.selectionEnd}:r={anchorNode:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset},vr&&or(vr,r)||(vr=r,0<(r=$r(gr,"onSelect")).length&&(n=new ot("onSelect","select",null,n,t),e.push({event:n,listeners:r}),n.target=hr)))}function wr(e,n){var t={};return t[e.toLowerCase()]=n.toLowerCase(),t["Webkit"+e]="webkit"+n,t["Moz"+e]="moz"+n,t}var kr={animationend:wr("Animation","AnimationEnd"),animationiteration:wr("Animation","AnimationIteration"),animationstart:wr("Animation","AnimationStart"),transitionend:wr("Transition","TransitionEnd")},Sr={},xr={};function Er(e){if(Sr[e])return Sr[e];if(!kr[e])return e;var n,t=kr[e];for(n in t)if(t.hasOwnProperty(n)&&n in xr)return Sr[e]=t[n];return e}u&&(xr=document.createElement("div").style,"AnimationEvent"in window||(delete kr.animationend.animation,delete kr.animationiteration.animation,delete kr.animationstart.animation),"TransitionEvent"in window||delete kr.transitionend.transition);var Cr=Er("animationend"),zr=Er("animationiteration"),Nr=Er("animationstart"),Pr=Er("transitionend"),Lr=new Map,Tr="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Mr(e,n){Lr.set(e,n),l(n,[e])}for(var Fr=0;Frxl||(e.current=Sl[xl],Sl[xl]=null,xl--)}function _l(e,n){xl++,Sl[xl]=e.current,e.current=n}var zl={},Nl=El(zl),Pl=El(!1),Ll=zl;function Tl(e,n){var t=e.type.contextTypes;if(!t)return zl;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===n)return r.__reactInternalMemoizedMaskedChildContext;var l,a={};for(l in t)a[l]=n[l];return r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=n,e.__reactInternalMemoizedMaskedChildContext=a),a}function Ml(e){return null!=(e=e.childContextTypes)}function Fl(){Cl(Pl),Cl(Nl)}function Rl(e,t,r){if(Nl.current!==zl)throw Error(n(168));_l(Nl,t),_l(Pl,r)}function Dl(e,t,r){var l=e.stateNode;if(t=t.childContextTypes,"function"!=typeof l.getChildContext)return r;for(var a in l=l.getChildContext())if(!(a in t))throw Error(n(108,Q(e)||"Unknown",a));return O({},r,l)}function Il(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||zl,Ll=Nl.current,_l(Nl,e),_l(Pl,Pl.current),!0}function Ol(e,t,r){var l=e.stateNode;if(!l)throw Error(n(169));r?(e=Dl(e,t,Ll),l.__reactInternalMemoizedMergedChildContext=e,Cl(Pl),Cl(Nl),_l(Nl,e)):Cl(Pl),_l(Pl,r)}var Ul=null,Vl=!1,Al=!1;function Bl(e){null===Ul?Ul=[e]:Ul.push(e)}function Hl(e){Vl=!0,Bl(e)}function Ql(){if(!Al&&null!==Ul){Al=!0;var e=0,n=gn;try{var t=Ul;for(gn=1;e>=u,l-=u,Gl=1<<32-en(n)+l|t<g?(v=d,d=null):v=d.sibling;var y=m(n,d,o[g],s);if(null===y){null===d&&(d=v);break}e&&d&&null===y.alternate&&t(n,d),a=u(y,a,g),null===f?c=y:f.sibling=y,f=y,d=v}if(g===o.length)return r(n,d),aa&&Jl(n,g),c;if(null===d){for(;gv?(y=g,g=null):y=g.sibling;var w=m(a,g,b.value,c);if(null===w){null===g&&(g=y);break}e&&g&&null===w.alternate&&t(a,g),o=u(w,o,v),null===d?f=w:d.sibling=w,d=w,g=y}if(b.done)return r(a,g),aa&&Jl(a,v),f;if(null===g){for(;!b.done;v++,b=s.next())null!==(b=p(a,b.value,c))&&(o=u(b,o,v),null===d?f=b:d.sibling=b,d=b);return aa&&Jl(a,v),f}for(g=l(a,g);!b.done;v++,b=s.next())null!==(b=h(g,a,v,b.value,c))&&(e&&null!==b.alternate&&g.delete(null===b.key?v:b.key),o=u(b,o,v),null===d?f=b:d.sibling=b,d=b);return e&&g.forEach((function(e){return t(a,e)})),aa&&Jl(a,v),f}return function e(n,l,u,s){if("object"==typeof u&&null!==u&&u.type===x&&null===u.key&&(u=u.props.children),"object"==typeof u&&null!==u){switch(u.$$typeof){case k:e:{for(var c=u.key,f=l;null!==f;){if(f.key===c){if((c=u.type)===x){if(7===f.tag){r(n,f.sibling),(l=a(f,u.props.children)).return=n,n=l;break e}}else if(f.elementType===c||"object"==typeof c&&null!==c&&c.$$typeof===M&&Xa(c)===f.type){r(n,f.sibling),(l=a(f,u.props)).ref=qa(n,f,u),l.return=n,n=l;break e}r(n,f);break}t(n,f),f=f.sibling}u.type===x?((l=Ws(u.props.children,n.mode,s,u.key)).return=n,n=l):((s=Qs(u.type,u.key,u.props,null,n.mode,s)).ref=qa(n,l,u),s.return=n,n=s)}return o(n);case S:e:{for(f=u.key;null!==l;){if(l.key===f){if(4===l.tag&&l.stateNode.containerInfo===u.containerInfo&&l.stateNode.implementation===u.implementation){r(n,l.sibling),(l=a(l,u.children||[])).return=n,n=l;break e}r(n,l);break}t(n,l),l=l.sibling}(l=Ks(u,n.mode,s)).return=n,n=l}return o(n);case M:return e(n,l,(f=u._init)(u._payload),s)}if(te(u))return g(n,l,u,s);if(D(u))return v(n,l,u,s);Ya(n,u)}return"string"==typeof u&&""!==u||"number"==typeof u?(u=""+u,null!==l&&6===l.tag?(r(n,l.sibling),(l=a(l,u)).return=n,n=l):(r(n,l),(l=$s(u,n.mode,s)).return=n,n=l),o(n)):r(n,l)}}var Za=Ga(!0),Ja=Ga(!1),eu={},nu=El(eu),tu=El(eu),ru=El(eu);function lu(e){if(e===eu)throw Error(n(174));return e}function au(e,n){switch(_l(ru,n),_l(tu,e),_l(nu,eu),e=n.nodeType){case 9:case 11:n=(n=n.documentElement)?n.namespaceURI:se(null,"");break;default:n=se(n=(e=8===e?n.parentNode:n).namespaceURI||null,e=e.tagName)}Cl(nu),_l(nu,n)}function uu(){Cl(nu),Cl(tu),Cl(ru)}function ou(e){lu(ru.current);var n=lu(nu.current),t=se(n,e.type);n!==t&&(_l(tu,e),_l(nu,t))}function iu(e){tu.current===e&&(Cl(nu),Cl(tu))}var su=El(0);function cu(e){for(var n=e;null!==n;){if(13===n.tag){var t=n.memoizedState;if(null!==t&&(null===(t=t.dehydrated)||"$?"===t.data||"$!"===t.data))return n}else if(19===n.tag&&void 0!==n.memoizedProps.revealOrder){if(128&n.flags)return n}else if(null!==n.child){n.child.return=n,n=n.child;continue}if(n===e)break;for(;null===n.sibling;){if(null===n.return||n.return===e)return null;n=n.return}n.sibling.return=n.return,n=n.sibling}return null}var fu=[];function du(){for(var e=0;et?t:4,e(!0);var r=mu.transition;mu.transition={};try{e(!1),n()}finally{gn=t,mu.transition=r}}function no(){return Nu().memoizedState}function to(e,n,t){var r=os(e);if(t={lane:r,action:t,hasEagerState:!1,eagerState:null,next:null},lo(e))ao(n,t);else if(null!==(t=La(e,n,t,r))){is(t,e,r,us()),uo(t,n,r)}}function ro(e,n,t){var r=os(e),l={lane:r,action:t,hasEagerState:!1,eagerState:null,next:null};if(lo(e))ao(n,l);else{var a=e.alternate;if(0===e.lanes&&(null===a||0===a.lanes)&&null!==(a=n.lastRenderedReducer))try{var u=n.lastRenderedState,o=a(u,t);if(l.hasEagerState=!0,l.eagerState=o,ur(o,u)){var s=n.interleaved;return null===s?(l.next=l,Pa(n)):(l.next=s.next,s.next=l),void(n.interleaved=l)}}catch(e){}null!==(t=La(e,n,l,r))&&(is(t,e,r,l=us()),uo(t,n,r))}}function lo(e){var n=e.alternate;return e===gu||null!==n&&n===gu}function ao(e,n){wu=bu=!0;var t=e.pending;null===t?n.next=n:(n.next=t.next,t.next=n),e.pending=n}function uo(e,n,t){if(4194240&t){var r=n.lanes;t|=r&=e.pendingLanes,n.lanes=t,hn(e,t)}}var oo={readContext:za,useCallback:xu,useContext:xu,useEffect:xu,useImperativeHandle:xu,useInsertionEffect:xu,useLayoutEffect:xu,useMemo:xu,useReducer:xu,useRef:xu,useState:xu,useDebugValue:xu,useDeferredValue:xu,useTransition:xu,useMutableSource:xu,useSyncExternalStore:xu,useId:xu,unstable_isNewReconciler:!1},io={readContext:za,useCallback:function(e,n){return zu().memoizedState=[e,void 0===n?null:n],e},useContext:za,useEffect:Wu,useImperativeHandle:function(e,n,t){return t=null!=t?t.concat([e]):null,Hu(4194308,4,qu.bind(null,n,e),t)},useLayoutEffect:function(e,n){return Hu(4194308,4,e,n)},useInsertionEffect:function(e,n){return Hu(4,2,e,n)},useMemo:function(e,n){var t=zu();return n=void 0===n?null:n,e=e(),t.memoizedState=[e,n],e},useReducer:function(e,n,t){var r=zu();return n=void 0!==t?t(n):n,r.memoizedState=r.baseState=n,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:n},r.queue=e,e=e.dispatch=to.bind(null,gu,e),[r.memoizedState,e]},useRef:function(e){return e={current:e},zu().memoizedState=e},useState:Vu,useDebugValue:Xu,useDeferredValue:function(e){return zu().memoizedState=e},useTransition:function(){var e=Vu(!1),n=e[0];return e=eo.bind(null,e[1]),zu().memoizedState=e,[n,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var l=gu,a=zu();if(aa){if(void 0===r)throw Error(n(407));r=r()}else{if(r=t(),null===Di)throw Error(n(349));30&hu||Ru(l,t,r)}a.memoizedState=r;var u={value:r,getSnapshot:t};return a.queue=u,Wu(Iu.bind(null,l,u,e),[e]),l.flags|=2048,Au(9,Du.bind(null,l,u,r,t),void 0,null),r},useId:function(){var e=zu(),n=Di.identifierPrefix;if(aa){var t=Zl;n=":"+n+"R"+(t=(Gl&~(1<<32-en(Gl)-1)).toString(32)+t),0<(t=ku++)&&(n+="H"+t.toString(32)),n+=":"}else n=":"+n+"r"+(t=Su++).toString(32)+":";return e.memoizedState=n},unstable_isNewReconciler:!1},so={readContext:za,useCallback:Gu,useContext:za,useEffect:ju,useImperativeHandle:Yu,useInsertionEffect:$u,useLayoutEffect:Ku,useMemo:Zu,useReducer:Lu,useRef:Bu,useState:function(){return Lu(Pu)},useDebugValue:Xu,useDeferredValue:function(e){return Ju(Nu(),vu.memoizedState,e)},useTransition:function(){return[Lu(Pu)[0],Nu().memoizedState]},useMutableSource:Mu,useSyncExternalStore:Fu,useId:no,unstable_isNewReconciler:!1},co={readContext:za,useCallback:Gu,useContext:za,useEffect:ju,useImperativeHandle:Yu,useInsertionEffect:$u,useLayoutEffect:Ku,useMemo:Zu,useReducer:Tu,useRef:Bu,useState:function(){return Tu(Pu)},useDebugValue:Xu,useDeferredValue:function(e){var n=Nu();return null===vu?n.memoizedState=e:Ju(n,vu.memoizedState,e)},useTransition:function(){return[Tu(Pu)[0],Nu().memoizedState]},useMutableSource:Mu,useSyncExternalStore:Fu,useId:no,unstable_isNewReconciler:!1};function fo(e,n){try{var t="",r=n;do{t+=B(r),r=r.return}while(r);var l=t}catch(e){l="\nError generating stack: "+e.message+"\n"+e.stack}return{value:e,source:n,stack:l,digest:null}}function po(e,n,t){return{value:e,source:null,stack:null!=t?t:null,digest:null!=n?n:null}}function mo(e,n){try{console.error(n.value)}catch(e){setTimeout((function(){throw e}))}}var ho="function"==typeof WeakMap?WeakMap:Map;function go(e,n,t){(t=Da(-1,t)).tag=3,t.payload={element:null};var r=n.value;return t.callback=function(){Xi||(Xi=!0,Gi=r),mo(0,n)},t}function vo(e,n,t){(t=Da(-1,t)).tag=3;var r=e.type.getDerivedStateFromError;if("function"==typeof r){var l=n.value;t.payload=function(){return r(l)},t.callback=function(){mo(0,n)}}var a=e.stateNode;return null!==a&&"function"==typeof a.componentDidCatch&&(t.callback=function(){mo(0,n),"function"!=typeof r&&(null===Zi?Zi=new Set([this]):Zi.add(this));var e=n.stack;this.componentDidCatch(n.value,{componentStack:null!==e?e:""})}),t}function yo(e,n,t){var r=e.pingCache;if(null===r){r=e.pingCache=new ho;var l=new Set;r.set(n,l)}else void 0===(l=r.get(n))&&(l=new Set,r.set(n,l));l.has(t)||(l.add(t),e=Fs.bind(null,e,n,t),n.then(e,e))}function bo(e){do{var n;if((n=13===e.tag)&&(n=null===(n=e.memoizedState)||null!==n.dehydrated),n)return e;e=e.return}while(null!==e);return null}function wo(e,n,t,r,l){return 1&e.mode?(e.flags|=65536,e.lanes=l,e):(e===n?e.flags|=65536:(e.flags|=128,t.flags|=131072,t.flags&=-52805,1===t.tag&&(null===t.alternate?t.tag=17:((n=Da(-1,1)).tag=2,Ia(t,n,1))),t.lanes|=1),e)}var ko=w.ReactCurrentOwner,So=!1;function xo(e,n,t,r){n.child=null===e?Ja(n,null,t,r):Za(n,e.child,t,r)}function Eo(e,n,t,r,l){t=t.render;var a=n.ref;return Ca(n,l),r=Cu(e,n,t,r,a,l),t=_u(),null===e||So?(aa&&t&&na(n),n.flags|=1,xo(e,n,r,l),n.child):(n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~l,qo(e,n,l))}function Co(e,n,t,r,l){if(null===e){var a=t.type;return"function"!=typeof a||As(a)||void 0!==a.defaultProps||null!==t.compare||void 0!==t.defaultProps?((e=Qs(t.type,null,r,n,n.mode,l)).ref=n.ref,e.return=n,n.child=e):(n.tag=15,n.type=a,_o(e,n,a,r,l))}if(a=e.child,!(e.lanes&l)){var u=a.memoizedProps;if((t=null!==(t=t.compare)?t:or)(u,r)&&e.ref===n.ref)return qo(e,n,l)}return n.flags|=1,(e=Hs(a,r)).ref=n.ref,e.return=n,n.child=e}function _o(e,n,t,r,l){if(null!==e){var a=e.memoizedProps;if(or(a,r)&&e.ref===n.ref){if(So=!1,n.pendingProps=r=a,!(e.lanes&l))return n.lanes=e.lanes,qo(e,n,l);131072&e.flags&&(So=!0)}}return Po(e,n,t,r,l)}function zo(e,n,t){var r=n.pendingProps,l=r.children,a=null!==e?e.memoizedState:null;if("hidden"===r.mode)if(1&n.mode){if(!(1073741824&t))return e=null!==a?a.baseLanes|t:t,n.lanes=n.childLanes=1073741824,n.memoizedState={baseLanes:e,cachePool:null,transitions:null},n.updateQueue=null,_l(Vi,Ui),Ui|=e,null;n.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=null!==a?a.baseLanes:t,_l(Vi,Ui),Ui|=r}else n.memoizedState={baseLanes:0,cachePool:null,transitions:null},_l(Vi,Ui),Ui|=t;else null!==a?(r=a.baseLanes|t,n.memoizedState=null):r=t,_l(Vi,Ui),Ui|=r;return xo(e,n,l,t),n.child}function No(e,n){var t=n.ref;(null===e&&null!==t||null!==e&&e.ref!==t)&&(n.flags|=512,n.flags|=2097152)}function Po(e,n,t,r,l){var a=Ml(t)?Ll:Nl.current;return a=Tl(n,a),Ca(n,l),t=Cu(e,n,t,r,a,l),r=_u(),null===e||So?(aa&&r&&na(n),n.flags|=1,xo(e,n,t,l),n.child):(n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~l,qo(e,n,l))}function Lo(e,n,t,r,l){if(Ml(t)){var a=!0;Il(n)}else a=!1;if(Ca(n,l),null===n.stateNode)Ko(e,n),ja(n,t,r),Ka(n,t,r,l),r=!0;else if(null===e){var u=n.stateNode,o=n.memoizedProps;u.props=o;var s=u.context,c=t.contextType;"object"==typeof c&&null!==c?c=za(c):c=Tl(n,c=Ml(t)?Ll:Nl.current);var f=t.getDerivedStateFromProps,d="function"==typeof f||"function"==typeof u.getSnapshotBeforeUpdate;d||"function"!=typeof u.UNSAFE_componentWillReceiveProps&&"function"!=typeof u.componentWillReceiveProps||(o!==r||s!==c)&&$a(n,u,r,c),Ma=!1;var p=n.memoizedState;u.state=p,Va(n,r,u,l),s=n.memoizedState,o!==r||p!==s||Pl.current||Ma?("function"==typeof f&&(Ha(n,t,f,r),s=n.memoizedState),(o=Ma||Wa(n,t,o,r,p,s,c))?(d||"function"!=typeof u.UNSAFE_componentWillMount&&"function"!=typeof u.componentWillMount||("function"==typeof u.componentWillMount&&u.componentWillMount(),"function"==typeof u.UNSAFE_componentWillMount&&u.UNSAFE_componentWillMount()),"function"==typeof u.componentDidMount&&(n.flags|=4194308)):("function"==typeof u.componentDidMount&&(n.flags|=4194308),n.memoizedProps=r,n.memoizedState=s),u.props=r,u.state=s,u.context=c,r=o):("function"==typeof u.componentDidMount&&(n.flags|=4194308),r=!1)}else{u=n.stateNode,Ra(e,n),o=n.memoizedProps,c=n.type===n.elementType?o:va(n.type,o),u.props=c,d=n.pendingProps,p=u.context,"object"==typeof(s=t.contextType)&&null!==s?s=za(s):s=Tl(n,s=Ml(t)?Ll:Nl.current);var m=t.getDerivedStateFromProps;(f="function"==typeof m||"function"==typeof u.getSnapshotBeforeUpdate)||"function"!=typeof u.UNSAFE_componentWillReceiveProps&&"function"!=typeof u.componentWillReceiveProps||(o!==d||p!==s)&&$a(n,u,r,s),Ma=!1,p=n.memoizedState,u.state=p,Va(n,r,u,l);var h=n.memoizedState;o!==d||p!==h||Pl.current||Ma?("function"==typeof m&&(Ha(n,t,m,r),h=n.memoizedState),(c=Ma||Wa(n,t,c,r,p,h,s)||!1)?(f||"function"!=typeof u.UNSAFE_componentWillUpdate&&"function"!=typeof u.componentWillUpdate||("function"==typeof u.componentWillUpdate&&u.componentWillUpdate(r,h,s),"function"==typeof u.UNSAFE_componentWillUpdate&&u.UNSAFE_componentWillUpdate(r,h,s)),"function"==typeof u.componentDidUpdate&&(n.flags|=4),"function"==typeof u.getSnapshotBeforeUpdate&&(n.flags|=1024)):("function"!=typeof u.componentDidUpdate||o===e.memoizedProps&&p===e.memoizedState||(n.flags|=4),"function"!=typeof u.getSnapshotBeforeUpdate||o===e.memoizedProps&&p===e.memoizedState||(n.flags|=1024),n.memoizedProps=r,n.memoizedState=h),u.props=r,u.state=h,u.context=s,r=c):("function"!=typeof u.componentDidUpdate||o===e.memoizedProps&&p===e.memoizedState||(n.flags|=4),"function"!=typeof u.getSnapshotBeforeUpdate||o===e.memoizedProps&&p===e.memoizedState||(n.flags|=1024),r=!1)}return To(e,n,t,r,a,l)}function To(e,n,t,r,l,a){No(e,n);var u=!!(128&n.flags);if(!r&&!u)return l&&Ol(n,t,!1),qo(e,n,a);r=n.stateNode,ko.current=n;var o=u&&"function"!=typeof t.getDerivedStateFromError?null:r.render();return n.flags|=1,null!==e&&u?(n.child=Za(n,e.child,null,a),n.child=Za(n,null,o,a)):xo(e,n,o,a),n.memoizedState=r.state,l&&Ol(n,t,!0),n.child}function Mo(e){var n=e.stateNode;n.pendingContext?Rl(0,n.pendingContext,n.pendingContext!==n.context):n.context&&Rl(0,n.context,!1),au(e,n.containerInfo)}function Fo(e,n,t,r,l){return ma(),ha(l),n.flags|=256,xo(e,n,t,r),n.child}var Ro,Do,Io,Oo,Uo={dehydrated:null,treeContext:null,retryLane:0};function Vo(e){return{baseLanes:e,cachePool:null,transitions:null}}function Ao(e,n,t){var r,l=n.pendingProps,a=su.current,u=!1,o=!!(128&n.flags);if((r=o)||(r=(null===e||null!==e.memoizedState)&&!!(2&a)),r?(u=!0,n.flags&=-129):null!==e&&null===e.memoizedState||(a|=1),_l(su,1&a),null===e)return ca(n),null!==(e=n.memoizedState)&&null!==(e=e.dehydrated)?(1&n.mode?"$!"===e.data?n.lanes=8:n.lanes=1073741824:n.lanes=1,null):(o=l.children,e=l.fallback,u?(l=n.mode,u=n.child,o={mode:"hidden",children:o},1&l||null===u?u=js(o,l,0,null):(u.childLanes=0,u.pendingProps=o),e=Ws(e,l,t,null),u.return=n,e.return=n,u.sibling=e,n.child=u,n.child.memoizedState=Vo(t),n.memoizedState=Uo,e):Bo(n,o));if(null!==(a=e.memoizedState)&&null!==(r=a.dehydrated))return Qo(e,n,o,l,r,a,t);if(u){u=l.fallback,o=n.mode,r=(a=e.child).sibling;var s={mode:"hidden",children:l.children};return 1&o||n.child===a?(l=Hs(a,s)).subtreeFlags=14680064&a.subtreeFlags:((l=n.child).childLanes=0,l.pendingProps=s,n.deletions=null),null!==r?u=Hs(r,u):(u=Ws(u,o,t,null)).flags|=2,u.return=n,l.return=n,l.sibling=u,n.child=l,l=u,u=n.child,o=null===(o=e.child.memoizedState)?Vo(t):{baseLanes:o.baseLanes|t,cachePool:null,transitions:o.transitions},u.memoizedState=o,u.childLanes=e.childLanes&~t,n.memoizedState=Uo,l}return e=(u=e.child).sibling,l=Hs(u,{mode:"visible",children:l.children}),!(1&n.mode)&&(l.lanes=t),l.return=n,l.sibling=null,null!==e&&(null===(t=n.deletions)?(n.deletions=[e],n.flags|=16):t.push(e)),n.child=l,n.memoizedState=null,l}function Bo(e,n){return(n=js({mode:"visible",children:n},e.mode,0,null)).return=e,e.child=n}function Ho(e,n,t,r){return null!==r&&ha(r),Za(n,e.child,null,t),(e=Bo(n,n.pendingProps.children)).flags|=2,n.memoizedState=null,e}function Qo(e,t,r,l,a,u,o){if(r)return 256&t.flags?(t.flags&=-257,Ho(e,t,o,l=po(Error(n(422))))):null!==t.memoizedState?(t.child=e.child,t.flags|=128,null):(u=l.fallback,a=t.mode,l=js({mode:"visible",children:l.children},a,0,null),(u=Ws(u,a,o,null)).flags|=2,l.return=t,u.return=t,l.sibling=u,t.child=l,1&t.mode&&Za(t,e.child,null,o),t.child.memoizedState=Vo(o),t.memoizedState=Uo,u);if(!(1&t.mode))return Ho(e,t,o,null);if("$!"===a.data){if(l=a.nextSibling&&a.nextSibling.dataset)var s=l.dgst;return l=s,Ho(e,t,o,l=po(u=Error(n(419)),l,void 0))}if(s=!!(o&e.childLanes),So||s){if(null!==(l=Di)){switch(o&-o){case 4:a=2;break;case 16:a=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:a=32;break;case 536870912:a=268435456;break;default:a=0}0!==(a=a&(l.suspendedLanes|o)?0:a)&&a!==u.retryLane&&(u.retryLane=a,Ta(e,a),is(l,e,a,-1))}return Ss(),Ho(e,t,o,l=po(Error(n(421))))}return"$?"===a.data?(t.flags|=128,t.child=e.child,t=Ds.bind(null,e),a._reactRetry=t,null):(e=u.treeContext,la=sl(a.nextSibling),ra=t,aa=!0,ua=null,null!==e&&(ql[Yl++]=Gl,ql[Yl++]=Zl,ql[Yl++]=Xl,Gl=e.id,Zl=e.overflow,Xl=t),(t=Bo(t,l.children)).flags|=4096,t)}function Wo(e,n,t){e.lanes|=n;var r=e.alternate;null!==r&&(r.lanes|=n),Ea(e.return,n,t)}function jo(e,n,t,r,l){var a=e.memoizedState;null===a?e.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:r,tail:t,tailMode:l}:(a.isBackwards=n,a.rendering=null,a.renderingStartTime=0,a.last=r,a.tail=t,a.tailMode=l)}function $o(e,n,t){var r=n.pendingProps,l=r.revealOrder,a=r.tail;if(xo(e,n,r.children,t),2&(r=su.current))r=1&r|2,n.flags|=128;else{if(null!==e&&128&e.flags)e:for(e=n.child;null!==e;){if(13===e.tag)null!==e.memoizedState&&Wo(e,t,n);else if(19===e.tag)Wo(e,t,n);else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===n)break e;for(;null===e.sibling;){if(null===e.return||e.return===n)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(_l(su,r),1&n.mode)switch(l){case"forwards":for(t=n.child,l=null;null!==t;)null!==(e=t.alternate)&&null===cu(e)&&(l=t),t=t.sibling;null===(t=l)?(l=n.child,n.child=null):(l=t.sibling,t.sibling=null),jo(n,!1,l,t,a);break;case"backwards":for(t=null,l=n.child,n.child=null;null!==l;){if(null!==(e=l.alternate)&&null===cu(e)){n.child=l;break}e=l.sibling,l.sibling=t,t=l,l=e}jo(n,!0,t,null,a);break;case"together":jo(n,!1,null,null,void 0);break;default:n.memoizedState=null}else n.memoizedState=null;return n.child}function Ko(e,n){!(1&n.mode)&&null!==e&&(e.alternate=null,n.alternate=null,n.flags|=2)}function qo(e,t,r){if(null!==e&&(t.dependencies=e.dependencies),Hi|=t.lanes,!(r&t.childLanes))return null;if(null!==e&&t.child!==e.child)throw Error(n(153));if(null!==t.child){for(r=Hs(e=t.child,e.pendingProps),t.child=r,r.return=t;null!==e.sibling;)e=e.sibling,(r=r.sibling=Hs(e,e.pendingProps)).return=t;r.sibling=null}return t.child}function Yo(e,n,t){switch(n.tag){case 3:Mo(n),ma();break;case 5:ou(n);break;case 1:Ml(n.type)&&Il(n);break;case 4:au(n,n.stateNode.containerInfo);break;case 10:var r=n.type._context,l=n.memoizedProps.value;_l(ya,r._currentValue),r._currentValue=l;break;case 13:if(null!==(r=n.memoizedState))return null!==r.dehydrated?(_l(su,1&su.current),n.flags|=128,null):t&n.child.childLanes?Ao(e,n,t):(_l(su,1&su.current),null!==(e=qo(e,n,t))?e.sibling:null);_l(su,1&su.current);break;case 19:if(r=!!(t&n.childLanes),128&e.flags){if(r)return $o(e,n,t);n.flags|=128}if(null!==(l=n.memoizedState)&&(l.rendering=null,l.tail=null,l.lastEffect=null),_l(su,su.current),r)break;return null;case 22:case 23:return n.lanes=0,zo(e,n,t)}return qo(e,n,t)}function Xo(e,n){if(!aa)switch(e.tailMode){case"hidden":n=e.tail;for(var t=null;null!==n;)null!==n.alternate&&(t=n),n=n.sibling;null===t?e.tail=null:t.sibling=null;break;case"collapsed":t=e.tail;for(var r=null;null!==t;)null!==t.alternate&&(r=t),t=t.sibling;null===r?n||null===e.tail?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Go(e){var n=null!==e.alternate&&e.alternate.child===e.child,t=0,r=0;if(n)for(var l=e.child;null!==l;)t|=l.lanes|l.childLanes,r|=14680064&l.subtreeFlags,r|=14680064&l.flags,l.return=e,l=l.sibling;else for(l=e.child;null!==l;)t|=l.lanes|l.childLanes,r|=l.subtreeFlags,r|=l.flags,l.return=e,l=l.sibling;return e.subtreeFlags|=r,e.childLanes=t,n}function Zo(e,t,l){var a=t.pendingProps;switch(ta(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Go(t),null;case 1:case 17:return Ml(t.type)&&Fl(),Go(t),null;case 3:return a=t.stateNode,uu(),Cl(Pl),Cl(Nl),du(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),null!==e&&null!==e.child||(da(t)?t.flags|=4:null===e||e.memoizedState.isDehydrated&&!(256&t.flags)||(t.flags|=1024,null!==ua&&(ds(ua),ua=null))),Do(e,t),Go(t),null;case 5:iu(t);var u=lu(ru.current);if(l=t.type,null!==e&&null!=t.stateNode)Io(e,t,l,a,u),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!a){if(null===t.stateNode)throw Error(n(166));return Go(t),null}if(e=lu(nu.current),da(t)){a=t.stateNode,l=t.type;var o=t.memoizedProps;switch(a[dl]=t,a[pl]=o,e=!!(1&t.mode),l){case"dialog":Vr("cancel",a),Vr("close",a);break;case"iframe":case"object":case"embed":Vr("load",a);break;case"video":case"audio":for(u=0;u<\/script>",e=e.removeChild(e.firstChild)):"string"==typeof a.is?e=s.createElement(l,{is:a.is}):(e=s.createElement(l),"select"===l&&(s=e,a.multiple?s.multiple=!0:a.size&&(s.size=a.size))):e=s.createElementNS(e,l),e[dl]=t,e[pl]=a,Ro(e,t,!1,!1),t.stateNode=e;e:{switch(s=we(l,a),l){case"dialog":Vr("cancel",e),Vr("close",e),u=a;break;case"iframe":case"object":case"embed":Vr("load",e),u=a;break;case"video":case"audio":for(u=0;uqi&&(t.flags|=128,a=!0,Xo(o,!1),t.lanes=4194304)}else{if(!a)if(null!==(e=cu(s))){if(t.flags|=128,a=!0,null!==(l=e.updateQueue)&&(t.updateQueue=l,t.flags|=4),Xo(o,!0),null===o.tail&&"hidden"===o.tailMode&&!s.alternate&&!aa)return Go(t),null}else 2*_r(_d[1]).unstable_now()-o.renderingStartTime>qi&&1073741824!==l&&(t.flags|=128,a=!0,Xo(o,!1),t.lanes=4194304);o.isBackwards?(s.sibling=t.child,t.child=s):(null!==(l=o.last)?l.sibling=s:t.child=s,o.last=s)}return null!==o.tail?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=_r(_d[1]).unstable_now(),t.sibling=null,l=su.current,_l(su,a?1&l|2:1&l),t):(Go(t),null);case 22:case 23:return ys(),a=null!==t.memoizedState,null!==e&&null!==e.memoizedState!==a&&(t.flags|=8192),a&&1&t.mode?!!(1073741824&Ui)&&(Go(t),6&t.subtreeFlags&&(t.flags|=8192)):Go(t),null;case 24:case 25:return null}throw Error(n(156,t.tag))}function Jo(e,t){switch(ta(t),t.tag){case 1:return Ml(t.type)&&Fl(),65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 3:return uu(),Cl(Pl),Cl(Nl),du(),65536&(e=t.flags)&&!(128&e)?(t.flags=-65537&e|128,t):null;case 5:return iu(t),null;case 13:if(Cl(su),null!==(e=t.memoizedState)&&null!==e.dehydrated){if(null===t.alternate)throw Error(n(340));ma()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 19:return Cl(su),null;case 4:return uu(),null;case 10:return xa(t.type._context),null;case 22:case 23:return ys(),null;default:return null}}Ro=function(e,n){for(var t=n.child;null!==t;){if(5===t.tag||6===t.tag)e.appendChild(t.stateNode);else if(4!==t.tag&&null!==t.child){t.child.return=t,t=t.child;continue}if(t===n)break;for(;null===t.sibling;){if(null===t.return||t.return===n)return;t=t.return}t.sibling.return=t.return,t=t.sibling}},Do=function(){},Io=function(e,n,t,l){var a=e.memoizedProps;if(a!==l){e=n.stateNode,lu(nu.current);var u,o=null;switch(t){case"input":a=X(e,a),l=X(e,l),o=[];break;case"select":a=O({},a,{value:void 0}),l=O({},l,{value:void 0}),o=[];break;case"textarea":a=le(e,a),l=le(e,l),o=[];break;default:"function"!=typeof a.onClick&&"function"==typeof l.onClick&&(e.onclick=Jr)}for(f in be(t,l),t=null,a)if(!l.hasOwnProperty(f)&&a.hasOwnProperty(f)&&null!=a[f])if("style"===f){var s=a[f];for(u in s)s.hasOwnProperty(u)&&(t||(t={}),t[u]="")}else"dangerouslySetInnerHTML"!==f&&"children"!==f&&"suppressContentEditableWarning"!==f&&"suppressHydrationWarning"!==f&&"autoFocus"!==f&&(r.hasOwnProperty(f)?o||(o=[]):(o=o||[]).push(f,null));for(f in l){var c=l[f];if(s=null!=a?a[f]:void 0,l.hasOwnProperty(f)&&c!==s&&(null!=c||null!=s))if("style"===f)if(s){for(u in s)!s.hasOwnProperty(u)||c&&c.hasOwnProperty(u)||(t||(t={}),t[u]="");for(u in c)c.hasOwnProperty(u)&&s[u]!==c[u]&&(t||(t={}),t[u]=c[u])}else t||(o||(o=[]),o.push(f,t)),t=c;else"dangerouslySetInnerHTML"===f?(c=c?c.__html:void 0,s=s?s.__html:void 0,null!=c&&s!==c&&(o=o||[]).push(f,c)):"children"===f?"string"!=typeof c&&"number"!=typeof c||(o=o||[]).push(f,""+c):"suppressContentEditableWarning"!==f&&"suppressHydrationWarning"!==f&&(r.hasOwnProperty(f)?(null!=c&&"onScroll"===f&&Vr("scroll",e),o||s===c||(o=[])):(o=o||[]).push(f,c))}t&&(o=o||[]).push("style",t);var f=o;(n.updateQueue=f)&&(n.flags|=4)}},Oo=function(e,n,t,r){t!==r&&(n.flags|=4)};var ei=!1,ni=!1,ti="function"==typeof WeakSet?WeakSet:Set,ri=null;function li(e,n){var t=e.ref;if(null!==t)if("function"==typeof t)try{t(null)}catch(t){Ms(e,n,t)}else t.current=null}function ai(e,n,t){try{t()}catch(t){Ms(e,n,t)}}var ui=!1;function oi(e,t){if(el=Hn,dr(e=fr())){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{var l=(r=(r=e.ownerDocument)&&r.defaultView||window).getSelection&&r.getSelection();if(l&&0!==l.rangeCount){r=l.anchorNode;var a=l.anchorOffset,u=l.focusNode;l=l.focusOffset;try{r.nodeType,u.nodeType}catch(e){r=null;break e}var o=0,s=-1,c=-1,f=0,d=0,p=e,m=null;n:for(;;){for(var h;p!==r||0!==a&&3!==p.nodeType||(s=o+a),p!==u||0!==l&&3!==p.nodeType||(c=o+l),3===p.nodeType&&(o+=p.nodeValue.length),null!==(h=p.firstChild);)m=p,p=h;for(;;){if(p===e)break n;if(m===r&&++f===a&&(s=o),m===u&&++d===l&&(c=o),null!==(h=p.nextSibling))break;m=(p=m).parentNode}p=h}r=-1===s||-1===c?null:{start:s,end:c}}else r=null}r=r||{start:0,end:0}}else r=null;for(nl={focusedElem:e,selectionRange:r},Hn=!1,ri=t;null!==ri;)if(e=(t=ri).child,1028&t.subtreeFlags&&null!==e)e.return=t,ri=e;else for(;null!==ri;){t=ri;try{var g=t.alternate;if(1024&t.flags)switch(t.tag){case 0:case 11:case 15:case 5:case 6:case 4:case 17:break;case 1:if(null!==g){var v=g.memoizedProps,y=g.memoizedState,b=t.stateNode,w=b.getSnapshotBeforeUpdate(t.elementType===t.type?v:va(t.type,v),y);b.__reactInternalSnapshotBeforeUpdate=w}break;case 3:var k=t.stateNode.containerInfo;1===k.nodeType?k.textContent="":9===k.nodeType&&k.documentElement&&k.removeChild(k.documentElement);break;default:throw Error(n(163))}}catch(e){Ms(t,t.return,e)}if(null!==(e=t.sibling)){e.return=t.return,ri=e;break}ri=t.return}return g=ui,ui=!1,g}function ii(e,n,t){var r=n.updateQueue;if(null!==(r=null!==r?r.lastEffect:null)){var l=r=r.next;do{if((l.tag&e)===e){var a=l.destroy;l.destroy=void 0,void 0!==a&&ai(n,t,a)}l=l.next}while(l!==r)}}function si(e,n){if(null!==(n=null!==(n=n.updateQueue)?n.lastEffect:null)){var t=n=n.next;do{if((t.tag&e)===e){var r=t.create;t.destroy=r()}t=t.next}while(t!==n)}}function ci(e){var n=e.ref;if(null!==n){var t=e.stateNode;e.tag,e=t,"function"==typeof n?n(e):n.current=e}}function fi(e){var n=e.alternate;null!==n&&(e.alternate=null,fi(n)),e.child=null,e.deletions=null,e.sibling=null,5===e.tag&&(null!==(n=e.stateNode)&&(delete n[dl],delete n[pl],delete n[hl],delete n[gl],delete n[vl])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function di(e){return 5===e.tag||3===e.tag||4===e.tag}function pi(e){e:for(;;){for(;null===e.sibling;){if(null===e.return||di(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;5!==e.tag&&6!==e.tag&&18!==e.tag;){if(2&e.flags)continue e;if(null===e.child||4===e.tag)continue e;e.child.return=e,e=e.child}if(!(2&e.flags))return e.stateNode}}function mi(e,n,t){var r=e.tag;if(5===r||6===r)e=e.stateNode,n?8===t.nodeType?t.parentNode.insertBefore(e,n):t.insertBefore(e,n):(8===t.nodeType?(n=t.parentNode).insertBefore(e,t):(n=t).appendChild(e),null!=(t=t._reactRootContainer)||null!==n.onclick||(n.onclick=Jr));else if(4!==r&&null!==(e=e.child))for(mi(e,n,t),e=e.sibling;null!==e;)mi(e,n,t),e=e.sibling}function hi(e,n,t){var r=e.tag;if(5===r||6===r)e=e.stateNode,n?t.insertBefore(e,n):t.appendChild(e);else if(4!==r&&null!==(e=e.child))for(hi(e,n,t),e=e.sibling;null!==e;)hi(e,n,t),e=e.sibling}var gi=null,vi=!1;function yi(e,n,t){for(t=t.child;null!==t;)bi(e,n,t),t=t.sibling}function bi(e,n,t){if(Ze&&"function"==typeof Ze.onCommitFiberUnmount)try{Ze.onCommitFiberUnmount(Ge,t)}catch(e){}switch(t.tag){case 5:ni||li(t,n);case 6:var r=gi,l=vi;gi=null,yi(e,n,t),vi=l,null!==(gi=r)&&(vi?(e=gi,t=t.stateNode,8===e.nodeType?e.parentNode.removeChild(t):e.removeChild(t)):gi.removeChild(t.stateNode));break;case 18:null!==gi&&(vi?(e=gi,t=t.stateNode,8===e.nodeType?il(e.parentNode,t):1===e.nodeType&&il(e,t),An(e)):il(gi,t.stateNode));break;case 4:r=gi,l=vi,gi=t.stateNode.containerInfo,vi=!0,yi(e,n,t),gi=r,vi=l;break;case 0:case 11:case 14:case 15:if(!ni&&(null!==(r=t.updateQueue)&&null!==(r=r.lastEffect))){l=r=r.next;do{var a=l,u=a.destroy;a=a.tag,void 0!==u&&(2&a||4&a)&&ai(t,n,u),l=l.next}while(l!==r)}yi(e,n,t);break;case 1:if(!ni&&(li(t,n),"function"==typeof(r=t.stateNode).componentWillUnmount))try{r.props=t.memoizedProps,r.state=t.memoizedState,r.componentWillUnmount()}catch(e){Ms(t,n,e)}yi(e,n,t);break;case 21:yi(e,n,t);break;case 22:1&t.mode?(ni=(r=ni)||null!==t.memoizedState,yi(e,n,t),ni=r):yi(e,n,t);break;default:yi(e,n,t)}}function wi(e){var n=e.updateQueue;if(null!==n){e.updateQueue=null;var t=e.stateNode;null===t&&(t=e.stateNode=new ti),n.forEach((function(n){var r=Is.bind(null,e,n);t.has(n)||(t.add(n),n.then(r,r))}))}}function ki(e,t){var r=t.deletions;if(null!==r)for(var l=0;la&&(a=o),l&=~u}if(l=a,10<(l=(120>(l=_r(_d[1]).unstable_now()-l)?120:480>l?480:1080>l?1080:1920>l?1920:3e3>l?3e3:4320>l?4320:1960*Li(l/1960))-l)){e.timeoutHandle=rl(Ns.bind(null,e,$i,Yi),l);break}Ns(e,$i,Yi);break;default:throw Error(n(329))}}}return ss(e,_r(_d[1]).unstable_now()),e.callbackNode===r?cs.bind(null,e):null}function fs(e,n){var t=ji;return e.current.memoizedState.isDehydrated&&(bs(e,n).flags|=256),2!==(e=xs(e,n))&&(n=$i,$i=t,null!==n&&ds(n)),e}function ds(e){null===$i?$i=e:$i.push.apply($i,e)}function ps(e){for(var n=e;;){if(16384&n.flags){var t=n.updateQueue;if(null!==t&&null!==(t=t.stores))for(var r=0;re?16:e,null===es)var l=!1;else{if(e=es,es=null,ns=0,6&Ri)throw Error(n(331));var a=Ri;for(Ri|=4,ri=e.current;null!==ri;){var u=ri,o=u.child;if(16&ri.flags){var s=u.deletions;if(null!==s){for(var c=0;c_r(_d[1]).unstable_now()-Ki?bs(e,0):Wi|=t),ss(e,n)}function Rs(e,n){0===n&&(1&e.mode?(n=ln,!(130023424&(ln<<=1))&&(ln=4194304)):n=1);var t=us();null!==(e=Ta(e,n))&&(pn(e,n,t),ss(e,t))}function Ds(e){var n=e.memoizedState,t=0;null!==n&&(t=n.retryLane),Rs(e,t)}function Is(e,t){var r=0;switch(e.tag){case 13:var l=e.stateNode,a=e.memoizedState;null!==a&&(r=a.retryLane);break;case 19:l=e.stateNode;break;default:throw Error(n(314))}null!==l&&l.delete(t),Rs(e,r)}function Os(e,n){return _r(_d[1]).unstable_scheduleCallback(e,n)}function Us(e,n,t,r){this.tag=e,this.key=t,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=n,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Vs(e,n,t,r){return new Us(e,n,t,r)}function As(e){return!(!(e=e.prototype)||!e.isReactComponent)}function Bs(e){if("function"==typeof e)return As(e)?1:0;if(null!=e){if((e=e.$$typeof)===N)return 11;if(e===T)return 14}return 2}function Hs(e,n){var t=e.alternate;return null===t?((t=Vs(e.tag,n,e.key,e.mode)).elementType=e.elementType,t.type=e.type,t.stateNode=e.stateNode,t.alternate=e,e.alternate=t):(t.pendingProps=n,t.type=e.type,t.flags=0,t.subtreeFlags=0,t.deletions=null),t.flags=14680064&e.flags,t.childLanes=e.childLanes,t.lanes=e.lanes,t.child=e.child,t.memoizedProps=e.memoizedProps,t.memoizedState=e.memoizedState,t.updateQueue=e.updateQueue,n=e.dependencies,t.dependencies=null===n?null:{lanes:n.lanes,firstContext:n.firstContext},t.sibling=e.sibling,t.index=e.index,t.ref=e.ref,t}function Qs(e,t,r,l,a,u){var o=2;if(l=e,"function"==typeof e)As(e)&&(o=1);else if("string"==typeof e)o=5;else e:switch(e){case x:return Ws(r.children,a,u,t);case E:o=8,a|=8;break;case C:return(e=Vs(12,r,t,2|a)).elementType=C,e.lanes=u,e;case P:return(e=Vs(13,r,t,a)).elementType=P,e.lanes=u,e;case L:return(e=Vs(19,r,t,a)).elementType=L,e.lanes=u,e;case F:return js(r,a,u,t);default:if("object"==typeof e&&null!==e)switch(e.$$typeof){case _:o=10;break e;case z:o=9;break e;case N:o=11;break e;case T:o=14;break e;case M:o=16,l=null;break e}throw Error(n(130,null==e?e:typeof e,""))}return(t=Vs(o,r,t,a)).elementType=e,t.type=l,t.lanes=u,t}function Ws(e,n,t,r){return(e=Vs(7,e,r,n)).lanes=t,e}function js(e,n,t,r){return(e=Vs(22,e,r,n)).elementType=F,e.lanes=t,e.stateNode={isHidden:!1},e}function $s(e,n,t){return(e=Vs(6,e,null,n)).lanes=t,e}function Ks(e,n,t){return(n=Vs(4,null!==e.children?e.children:[],e.key,n)).lanes=t,n.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},n}function qs(e,n,t,r,l){this.tag=n,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=dn(0),this.expirationTimes=dn(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=dn(0),this.identifierPrefix=r,this.onRecoverableError=l,this.mutableSourceEagerHydrationData=null}function Ys(e,n,t,r,l,a,u,o,s){return e=new qs(e,n,t,o,s),1===n?(n=1,!0===a&&(n|=8)):n=0,a=Vs(3,null,null,n),e.current=a,a.stateNode=e,a.memoizedState={element:r,isDehydrated:t,cache:null,transitions:null,pendingSuspenseBoundaries:null},Fa(a),e}function Xs(e,n,t){var r=31?t-1:0),o=1;o1?t-1:0),o=1;o1){for(var f=Array(l),p=0;p1){for(var y=Array(p),h=0;h import('./MyComponent'))\n\nDid you accidentally put curly braces around the import?",o),'default'in o||L("lazy: Expected the result of a dynamic import() call. Instead received: %s\n\nYour code should look like: \n const MyComponent = lazy(() => import('./MyComponent'))",o),o.default}throw e._result}function $e(e){return'string'==typeof e||'function'==typeof e||(!!(e===n||e===a||x||e===o||e===c||e===l||T||e===y||E||j||P)||'object'==typeof e&&null!==e&&(e.$$typeof===p||e.$$typeof===f||e.$$typeof===i||e.$$typeof===u||e.$$typeof===s||e.$$typeof===Re||void 0!==e.getModuleId))}function De(){var e=_.current;return null===e&&L("Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem."),e}Re=Symbol.for('react.module.reference');var Le,Ie,Ne,Fe,Ae,Me,Ve,ze=0;function Ue(){}function Be(){if(0===ze){Le=console.log,Ie=console.info,Ne=console.warn,Fe=console.error,Ae=console.group,Me=console.groupCollapsed,Ve=console.groupEnd;var e={configurable:!0,enumerable:!0,value:Ue,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}ze++}function Ye(){if(0===--ze){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:M({},e,{value:Le}),info:M({},e,{value:Ie}),warn:M({},e,{value:Ne}),error:M({},e,{value:Fe}),group:M({},e,{value:Ae}),groupCollapsed:M({},e,{value:Me}),groupEnd:M({},e,{value:Ve})})}ze<0&&L("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}Ue.__reactDisabledLog=!0;var qe,He=$.ReactCurrentDispatcher;function We(e,t,n){if(void 0===qe)try{throw Error()}catch(e){var o=e.stack.trim().match(/\n( *(at )?)/);qe=o&&o[1]||''}return'\n'+qe+e}var Ge,Ke=!1,Je='function'==typeof WeakMap?WeakMap:Map;function Xe(e,t){if(!e||Ke)return'';var n,o=Ge.get(e);if(void 0!==o)return o;Ke=!0;var a,i=Error.prepareStackTrace;Error.prepareStackTrace=void 0,a=He.current,He.current=null,Be();try{if(t){var u=function(){throw Error()};if(Object.defineProperty(u.prototype,'props',{set:function(){throw Error()}}),'object'==typeof Reflect&&Reflect.construct){try{Reflect.construct(u,[])}catch(e){n=e}Reflect.construct(e,[],u)}else{try{u.call()}catch(e){n=e}e.call(u.prototype)}}else{try{throw Error()}catch(e){n=e}e()}}catch(t){if(t&&n&&'string'==typeof t.stack){for(var s=t.stack.split('\n'),c=n.stack.split('\n'),l=s.length-1,f=c.length-1;l>=1&&f>=0&&s[l]!==c[f];)f--;for(;l>=1&&f>=0;l--,f--)if(s[l]!==c[f]){if(1!==l||1!==f)do{if(l--,--f<0||s[l]!==c[f]){var p='\n'+s[l].replace(' at new ',' at ');return e.displayName&&p.includes('')&&(p=p.replace('',e.displayName)),'function'==typeof e&&Ge.set(e,p),p}}while(l>=1&&f>=0);break}}}finally{Ke=!1,He.current=a,Ye(),Error.prepareStackTrace=i}var y=e?e.displayName||e.name:'',h=y?We(y):'';return'function'==typeof e&&Ge.set(e,h),h}function Qe(e){var t=e.prototype;return!(!t||!t.isReactComponent)}function Ze(e,t,n){if(null==e)return'';if('function'==typeof e)return Xe(e,Qe(e));if('string'==typeof e)return We(e);switch(e){case c:return We('Suspense');case l:return We('SuspenseList')}if('object'==typeof e)switch(e.$$typeof){case s:return Xe(e.render,!1);case f:return Ze(e.type,t,n);case p:var o=e,a=o._payload,i=o._init;try{return Ze(i(a),t,n)}catch(e){}}return''}Ge=new Je;var et,tt={},rt=$.ReactDebugCurrentFrame;function nt(e){if(e){var t=e._owner,n=Ze(e.type,e._source,t?t.type:null);rt.setExtraStackFrame(n)}else rt.setExtraStackFrame(null)}function ot(e,t,n,o,a){var i=Function.call.bind(ie);for(var u in e)if(i(e,u)){var s=void 0;try{if('function'!=typeof e[u]){var c=Error((o||'React class')+': '+n+' type `'+u+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[u]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw c.name='Invariant Violation',c}s=e[u](t,u,o,n,null,'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED')}catch(e){s=e}!s||s instanceof Error||(nt(a),L("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",o||'React class',n,u,typeof s),nt(null)),s instanceof Error&&!(s.message in tt)&&(tt[s.message]=!0,nt(a),L('Failed %s type: %s',n,s.message),nt(null))}}function at(e){if(e){var t=e._owner;R(Ze(e.type,e._source,t?t.type:null))}else R(null)}function it(){if(O.current){var e=re(O.current.type);if(e)return'\n\nCheck the render method of `'+e+'`.'}return''}et=!1;var ut={};function st(e){var t=it();if(!t){var n='string'==typeof e?e:e.displayName||e.name;n&&(t="\n\nCheck the top-level render call using <"+n+">.")}return t}function ct(e,t){if(e._store&&!e._store.validated&&null==e.key){e._store.validated=!0;var n=st(t);if(!ut[n]){ut[n]=!0;var o='';e&&e._owner&&e._owner!==O.current&&(o=" It was passed a child from "+re(e._owner.type)+"."),at(e),L("Each child in a list should have a unique \"key\" prop.%s%s See https://reactjs.org/link/warning-keys for more information.",n,o),at(null)}}}function lt(e,t){if('object'==typeof e)if(K(e))for(var n=0;n",c=' Did you accidentally export a JSX literal instead of a component?'):l=typeof t,L("React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",l,c)}var p=ye.apply(this,arguments);if(null==p)return p;if(s)for(var y=2;y ...) will fail. Please file an issue at https://github.com/facebook/react/issues if you encounter this warning."));var t=new MessageChannel;t.port1.onmessage=e,t.port2.postMessage(void 0)}}return ht(e)}var gt=0,bt=!1;function _t(e){var t=gt;gt++,null===k.current&&(k.current=[]);var n,o=k.isBatchingLegacy;try{if(k.isBatchingLegacy=!0,n=e(),!o&&k.didScheduleLegacyUpdate){var a=k.current;null!==a&&(k.didScheduleLegacyUpdate=!1,St(a))}}catch(e){throw wt(t),e}finally{k.isBatchingLegacy=o}if(null!==n&&'object'==typeof n&&'function'==typeof n.then){var i=n,u=!1,s={then:function(e,n){u=!0,i.then((function(o){wt(t),0===gt?kt(o,e,n):e(o)}),(function(e){wt(t),n(e)}))}};return bt||'undefined'==typeof Promise||Promise.resolve().then((function(){})).then((function(){u||(bt=!0,L("You called act(async () => ...) without await. This could lead to unexpected testing behaviour, interleaving multiple act calls and mixing their scopes. You should - await act(async () => ...);"))})),s}var c=n;if(wt(t),0===gt){var l=k.current;return null!==l&&(St(l),k.current=null),{then:function(e,t){null===k.current?(k.current=[],kt(c,e,t)):e(c)}}}return{then:function(e,t){e(c)}}}function wt(e){e!==gt-1&&L("You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. "),gt=e}function kt(e,t,n){var o=k.current;if(null!==o)try{St(o),vt((function(){0===o.length?(k.current=null,t(e)):kt(e,t,n)}))}catch(e){n(e)}else t(e)}var Ot=!1;function St(e){if(!Ot){Ot=!0;var t=0;try{for(;t is not supported and will be removed in a future major release. Did you mean to render instead?")),t.Provider},set:function(e){t.Provider=e}},_currentValue:{get:function(){return t._currentValue},set:function(e){t._currentValue=e}},_currentValue2:{get:function(){return t._currentValue2},set:function(e){t._currentValue2=e}},_threadCount:{get:function(){return t._threadCount},set:function(e){t._threadCount=e}},Consumer:{get:function(){return n||(n=!0,L("Rendering is not supported and will be removed in a future major release. Did you mean to render instead?")),t.Consumer}},displayName:{get:function(){return t.displayName},set:function(e){a||(D("Setting `displayName` on Context.Consumer has no effect. You should set it directly on the context with Context.displayName = '%s'.",e),a=!0)}}}),t.Consumer=s,t._currentRenderer=null,t._currentRenderer2=null,t},_e.createElement=Ct,_e.createFactory=Et,_e.createRef=function(){var e={current:null};return Object.seal(e),e},_e.forwardRef=function(e){null!=e&&e.$$typeof===f?L("forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."):'function'!=typeof e?L('forwardRef requires a render function but was given %s.',null===e?'null':typeof e):0!==e.length&&2!==e.length&&L('forwardRef render functions accept exactly two parameters: props and ref. %s',1===e.length?'Did you forget to use the ref parameter?':'Any additional parameter will be undefined.'),null!=e&&(null==e.defaultProps&&null==e.propTypes||L("forwardRef render functions do not support propTypes or defaultProps. Did you accidentally pass a React component?"));var t,n={$$typeof:s,render:e};return Object.defineProperty(n,'displayName',{enumerable:!1,configurable:!0,get:function(){return t},set:function(n){t=n,e.name||e.displayName||(e.displayName=n)}}),n},_e.isValidElement=he,_e.lazy=function(e){var t,n,o={$$typeof:p,_payload:{_status:Ee,_result:e},_init:xe};return Object.defineProperties(o,{defaultProps:{configurable:!0,get:function(){return t},set:function(e){L("React.lazy(...): It is not supported to assign `defaultProps` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it."),t=e,Object.defineProperty(o,'defaultProps',{enumerable:!0})}},propTypes:{configurable:!0,get:function(){return n},set:function(e){L("React.lazy(...): It is not supported to assign `propTypes` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it."),n=e,Object.defineProperty(o,'propTypes',{enumerable:!0})}}}),o},_e.memo=function(e,t){$e(e)||L("memo: The first argument must be a component. Instead received: %s",null===e?'null':typeof e);var n,o={$$typeof:f,type:e,compare:void 0===t?null:t};return Object.defineProperty(o,'displayName',{enumerable:!1,configurable:!0,get:function(){return n},set:function(t){n=t,e.name||e.displayName||(e.displayName=t)}}),o},_e.startTransition=function(e,t){var n=w.transition;w.transition={};var o=w.transition;w.transition._updatedFibers=new Set;try{e()}finally{if(w.transition=n,null===n&&o._updatedFibers)o._updatedFibers.size>10&&D("Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table."),o._updatedFibers.clear()}},_e.unstable_act=_t,_e.useCallback=function(e,t){return De().useCallback(e,t)},_e.useContext=function(e){var t=De();if(void 0!==e._context){var n=e._context;n.Consumer===e?L("Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be removed in a future major release. Did you mean to call useContext(Context) instead?"):n.Provider===e&&L("Calling useContext(Context.Provider) is not supported. Did you mean to call useContext(Context) instead?")}return t.useContext(e)},_e.useDebugValue=function(e,t){return De().useDebugValue(e,t)},_e.useDeferredValue=function(e){return De().useDeferredValue(e)},_e.useEffect=function(e,t){return De().useEffect(e,t)},_e.useId=function(){return De().useId()},_e.useImperativeHandle=function(e,t,n){return De().useImperativeHandle(e,t,n)},_e.useInsertionEffect=function(e,t){return De().useInsertionEffect(e,t)},_e.useLayoutEffect=function(e,t){return De().useLayoutEffect(e,t)},_e.useMemo=function(e,t){return De().useMemo(e,t)},_e.useReducer=function(e,t,n){return De().useReducer(e,t,n)},_e.useRef=function(e){return De().useRef(e)},_e.useState=function(e){return De().useState(e)},_e.useSyncExternalStore=function(e,t,n){return De().useSyncExternalStore(e,t,n)},_e.useTransition=function(){return De().useTransition()},_e.version='18.3.1','undefined'!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&'function'==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)})()}),84,[]); +__d((function(g,_r,_i,_a,m,_e,d){Object.defineProperty(_e,"__esModule",{value:!0}),_e.LocaleProvider=function(t){var r=t.direction,l=t.locale,c=t.children;return r||l?e.default.createElement(n.Provider,{children:c,value:{direction:l?o(l):r,locale:l}}):c},_e.getLocaleDirection=o,_e.useLocaleContext=function(){return(0,e.useContext)(n)};var e=(function(e,r){if(!r&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=t(r);if(n&&n.has(e))return n.get(e);var o={__proto__:null},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var c in e)if("default"!==c&&{}.hasOwnProperty.call(e,c)){var i=l?Object.getOwnPropertyDescriptor(e,c):null;i&&(i.get||i.set)?Object.defineProperty(o,c,i):o[c]=e[c]}return o.default=e,n&&n.set(e,o),o})(_r(d[0]));function t(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap,n=new WeakMap;return(t=function(e){return e?n:r})(e)}var r={direction:'ltr',locale:'en-US'},n=(0,e.createContext)(r);function o(e){return(0,_r(d[1]).isLocaleRTL)(e)?'rtl':'ltr'}}),85,[82,86]); +__d((function(g,r,i,a,m,e,d){Object.defineProperty(e,"__esModule",{value:!0}),e.isLocaleRTL=function(l){var o=c.get(l);if(o)return o;var s=!1;if(Intl.Locale){var u=new Intl.Locale(l).maximize().script;s=n.has(u)}else{var b=l.split('-')[0];s=t.has(b)}return c.set(l,s),s};var n=new Set(['Arab','Syrc','Samr','Mand','Thaa','Mend','Nkoo','Adlm','Rohg','Hebr']),t=new Set(['ae','ar','arc','bcc','bqi','ckb','dv','fa','far','glk','he','iw','khw','ks','ku','mzn','nqo','pnb','ps','sd','ug','ur','yi']),c=new Map}),86,[]); +__d((function(g,r,i,a,m,_e,d){Object.defineProperty(_e,"__esModule",{value:!0}),_e.default=void 0;_e.default=function(e){var t;try{t=(0,r(d[0]).findDOMNode)(e)}catch(e){}return t}}),87,[88]); +__d((function(g,r,i,a,m,e,d){'use strict';'production'===process.env.NODE_ENV?(!(function _(){if('undefined'!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&'function'==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE){if('production'!==process.env.NODE_ENV)throw new Error('^_^');try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(_)}catch(_){console.error(_)}}})(),m.exports=r(d[0])):m.exports=r(d[1])}),88,[89,93]); __d((function(_g,_r,i,_a,_m,_e,_d){ /** * @license React - * react.production.min.js + * react-dom.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ -'use strict';var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),u=Symbol.for("react.provider"),c=Symbol.for("react.context"),a=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),l=Symbol.for("react.memo"),s=Symbol.for("react.lazy"),p=Symbol.iterator;function y(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=p&&e[p]||e["@@iterator"])?e:null}var d={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,h={};function m(e,t,r){this.props=e,this.context=t,this.refs=h,this.updater=r||d}function v(){}function b(e,t,r){this.props=e,this.context=t,this.refs=h,this.updater=r||d}m.prototype.isReactComponent={},m.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},m.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},v.prototype=m.prototype;var S=b.prototype=new v;S.constructor=b,_(S,m.prototype),S.isPureReactComponent=!0;var E=Array.isArray,$=Object.prototype.hasOwnProperty,w={current:null},R={key:!0,ref:!0,__self:!0,__source:!0};function k(t,r,n){var o,u={},c=null,a=null;if(null!=r)for(o in void 0!==r.ref&&(a=r.ref),void 0!==r.key&&(c=""+r.key),r)$.call(r,o)&&!R.hasOwnProperty(o)&&(u[o]=r[o]);var f=arguments.length-2;if(1===f)u.children=n;else if(1n}return!1}function h(e,n,t,r,l,a,u){this.acceptsBooleans=2===n||3===n||4===n,this.attributeName=r,this.attributeNamespace=l,this.mustUseProperty=t,this.propertyName=e,this.type=n,this.sanitizeURL=a,this.removeEmptyString=u}var g={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach((function(e){g[e]=new h(e,0,!1,e,null,!1,!1)})),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach((function(e){var n=e[0];g[n]=new h(n,1,!1,e[1],null,!1,!1)})),["contentEditable","draggable","spellCheck","value"].forEach((function(e){g[e]=new h(e,2,!1,e.toLowerCase(),null,!1,!1)})),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach((function(e){g[e]=new h(e,2,!1,e,null,!1,!1)})),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach((function(e){g[e]=new h(e,3,!1,e.toLowerCase(),null,!1,!1)})),["checked","multiple","muted","selected"].forEach((function(e){g[e]=new h(e,3,!0,e,null,!1,!1)})),["capture","download"].forEach((function(e){g[e]=new h(e,4,!1,e,null,!1,!1)})),["cols","rows","size","span"].forEach((function(e){g[e]=new h(e,6,!1,e,null,!1,!1)})),["rowSpan","start"].forEach((function(e){g[e]=new h(e,5,!1,e.toLowerCase(),null,!1,!1)}));var v=/[\-:]([a-z])/g;function y(e){return e[1].toUpperCase()}function b(e,n,t,r){var l=g.hasOwnProperty(n)?g[n]:null;(null!==l?0!==l.type:r||!(2--o||l[u]!==a[o]){var s="\n"+l[u].replace(" at new "," at ");return e.displayName&&s.includes("")&&(s=s.replace("",e.displayName)),s}}while(1<=u&&0<=o);break}}}finally{V=!1,Error.prepareStackTrace=t}return(e=e?e.displayName||e.name:"")?U(e):""}function B(e){switch(e.tag){case 5:return U(e.type);case 16:return U("Lazy");case 13:return U("Suspense");case 19:return U("SuspenseList");case 0:case 2:case 15:return e=A(e.type,!1);case 11:return e=A(e.type.render,!1);case 1:return e=A(e.type,!0);default:return""}}function H(e){if(null==e)return null;if("function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case x:return"Fragment";case S:return"Portal";case C:return"Profiler";case E:return"StrictMode";case P:return"Suspense";case L:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case z:return(e.displayName||"Context")+".Consumer";case _:return(e._context.displayName||"Context")+".Provider";case N:var n=e.render;return(e=e.displayName)||(e=""!==(e=n.displayName||n.name||"")?"ForwardRef("+e+")":"ForwardRef"),e;case T:return null!==(n=e.displayName||null)?n:H(e.type)||"Memo";case M:n=e._payload,e=e._init;try{return H(e(n))}catch(e){}}return null}function Q(e){var n=e.type;switch(e.tag){case 24:return"Cache";case 9:return(n.displayName||"Context")+".Consumer";case 10:return(n._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=(e=n.render).displayName||e.name||"",n.displayName||(""!==e?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return n;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return H(n);case 8:return n===E?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if("function"==typeof n)return n.displayName||n.name||null;if("string"==typeof n)return n}return null}function W(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":case"object":return e;default:return""}}function j(e){var n=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===n||"radio"===n)}function $(e){var n=j(e)?"checked":"value",t=Object.getOwnPropertyDescriptor(e.constructor.prototype,n),r=""+e[n];if(!e.hasOwnProperty(n)&&void 0!==t&&"function"==typeof t.get&&"function"==typeof t.set){var l=t.get,a=t.set;return Object.defineProperty(e,n,{configurable:!0,get:function(){return l.call(this)},set:function(e){r=""+e,a.call(this,e)}}),Object.defineProperty(e,n,{enumerable:t.enumerable}),{getValue:function(){return r},setValue:function(e){r=""+e},stopTracking:function(){e._valueTracker=null,delete e[n]}}}}function K(e){e._valueTracker||(e._valueTracker=$(e))}function q(e){if(!e)return!1;var n=e._valueTracker;if(!n)return!0;var t=n.getValue(),r="";return e&&(r=j(e)?e.checked?"true":"false":e.value),(e=r)!==t&&(n.setValue(e),!0)}function Y(e){if(void 0===(e=e||("undefined"!=typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(n){return e.body}}function X(e,n){var t=n.checked;return O({},n,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=t?t:e._wrapperState.initialChecked})}function G(e,n){var t=null==n.defaultValue?"":n.defaultValue,r=null!=n.checked?n.checked:n.defaultChecked;t=W(null!=n.value?n.value:t),e._wrapperState={initialChecked:r,initialValue:t,controlled:"checkbox"===n.type||"radio"===n.type?null!=n.checked:null!=n.value}}function Z(e,n){null!=(n=n.checked)&&b(e,"checked",n,!1)}function J(e,n){Z(e,n);var t=W(n.value),r=n.type;if(null!=t)"number"===r?(0===t&&""===e.value||e.value!=t)&&(e.value=""+t):e.value!==""+t&&(e.value=""+t);else if("submit"===r||"reset"===r)return void e.removeAttribute("value");n.hasOwnProperty("value")?ne(e,n.type,t):n.hasOwnProperty("defaultValue")&&ne(e,n.type,W(n.defaultValue)),null==n.checked&&null!=n.defaultChecked&&(e.defaultChecked=!!n.defaultChecked)}function ee(e,n,t){if(n.hasOwnProperty("value")||n.hasOwnProperty("defaultValue")){var r=n.type;if(!("submit"!==r&&"reset"!==r||void 0!==n.value&&null!==n.value))return;n=""+e._wrapperState.initialValue,t||n===e.value||(e.value=n),e.defaultValue=n}""!==(t=e.name)&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,""!==t&&(e.name=t)}function ne(e,n,t){"number"===n&&Y(e.ownerDocument)===e||(null==t?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+t&&(e.defaultValue=""+t))}var te=Array.isArray;function re(e,n,t,r){if(e=e.options,n){n={};for(var l=0;l"+n.valueOf().toString()+"",n=ce.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;n.firstChild;)e.appendChild(n.firstChild)}},"undefined"!=typeof MSApp&&MSApp.execUnsafeLocalFunction?function(e,n,t,r){MSApp.execUnsafeLocalFunction((function(){return fe(e,n)}))}:fe);function pe(e,n){if(n){var t=e.firstChild;if(t&&t===e.lastChild&&3===t.nodeType)return void(t.nodeValue=n)}e.textContent=n}var me={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},he=["Webkit","ms","Moz","O"];function ge(e,n,t){return null==n||"boolean"==typeof n||""===n?"":t||"number"!=typeof n||0===n||me.hasOwnProperty(e)&&me[e]?(""+n).trim():n+"px"}function ve(e,n){for(var t in e=e.style,n)if(n.hasOwnProperty(t)){var r=0===t.indexOf("--"),l=ge(t,n[t],r);"float"===t&&(t="cssFloat"),r?e.setProperty(t,l):e[t]=l}}Object.keys(me).forEach((function(e){he.forEach((function(n){n=n+e.charAt(0).toUpperCase()+e.substring(1),me[n]=me[e]}))}));var ye=O({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function be(e,t){if(t){if(ye[e]&&(null!=t.children||null!=t.dangerouslySetInnerHTML))throw Error(n(137,e));if(null!=t.dangerouslySetInnerHTML){if(null!=t.children)throw Error(n(60));if("object"!=typeof t.dangerouslySetInnerHTML||!("__html"in t.dangerouslySetInnerHTML))throw Error(n(61))}if(null!=t.style&&"object"!=typeof t.style)throw Error(n(62))}}function we(e,n){if(-1===e.indexOf("-"))return"string"==typeof n.is;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var ke=null;function Se(e){return(e=e.target||e.srcElement||window).correspondingUseElement&&(e=e.correspondingUseElement),3===e.nodeType?e.parentNode:e}var xe=null,Ee=null,Ce=null;function ze(e){if(e=bl(e)){if("function"!=typeof xe)throw Error(n(280));var t=e.stateNode;t&&(t=kl(t),xe(e.stateNode,e.type,t))}}function Ne(e){Ee?Ce?Ce.push(e):Ce=[e]:Ee=e}function Pe(){if(Ee){var e=Ee,n=Ce;if(Ce=Ee=null,ze(e),n)for(e=0;e>>=0,0===e?32:31-(nn(e)/tn|0)|0},nn=Math.log,tn=Math.LN2;var rn=64,ln=4194304;function an(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return 4194240&e;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return 130023424&e;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function un(e,n){var t=e.pendingLanes;if(0===t)return 0;var r=0,l=e.suspendedLanes,a=e.pingedLanes,u=268435455&t;if(0!==u){var o=u&~l;0!==o?r=an(o):0!==(a&=u)&&(r=an(a))}else 0!==(u=t&~l)?r=an(u):0!==a&&(r=an(a));if(0===r)return 0;if(0!==n&&n!==r&&!(n&l)&&((l=r&-r)>=(a=n&-n)||16===l&&4194240&a))return n;if(4&r&&(r|=16&t),0!==(n=e.entangledLanes))for(e=e.entanglements,n&=r;0t;t++)n.push(e);return n}function pn(e,n,t){e.pendingLanes|=n,536870912!==n&&(e.suspendedLanes=0,e.pingedLanes=0),(e=e.eventTimes)[n=31-en(n)]=t}function mn(e,n){var t=e.pendingLanes&~n;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=n,e.mutableReadLanes&=n,e.entangledLanes&=n,n=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=Mt),Dt=String.fromCharCode(32),It=!1;function Ot(e,n){switch(e){case"keyup":return-1!==Lt.indexOf(n.keyCode);case"keydown":return 229!==n.keyCode;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ut(e){return"object"==typeof(e=e.detail)&&"data"in e?e.data:null}var Vt=!1;function At(e,n){switch(e){case"compositionend":return Ut(n);case"keypress":return 32!==n.which?null:(It=!0,Dt);case"textInput":return(e=n.data)===Dt&&It?null:e;default:return null}}function Bt(e,n){if(Vt)return"compositionend"===e||!Tt&&Ot(e,n)?(e=Zn(),Gn=Xn=Yn=null,Vt=!1,e):null;switch(e){case"paste":default:return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1=n)return{node:r,offset:n-e};e=t}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=ir(r)}}function cr(e,n){return!(!e||!n)&&(e===n||(!e||3!==e.nodeType)&&(n&&3===n.nodeType?cr(e,n.parentNode):"contains"in e?e.contains(n):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(n))))}function fr(){for(var e=window,n=Y();n instanceof e.HTMLIFrameElement;){try{var t="string"==typeof n.contentWindow.location.href}catch(e){t=!1}if(!t)break;n=Y((e=n.contentWindow).document)}return n}function dr(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n&&("input"===n&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===n||"true"===e.contentEditable)}function pr(e){var n=fr(),t=e.focusedElem,r=e.selectionRange;if(n!==t&&t&&t.ownerDocument&&cr(t.ownerDocument.documentElement,t)){if(null!==r&&dr(t))if(n=r.start,void 0===(e=r.end)&&(e=n),"selectionStart"in t)t.selectionStart=n,t.selectionEnd=Math.min(e,t.value.length);else if((e=(n=t.ownerDocument||document)&&n.defaultView||window).getSelection){e=e.getSelection();var l=t.textContent.length,a=Math.min(r.start,l);r=void 0===r.end?a:Math.min(r.end,l),!e.extend&&a>r&&(l=r,r=a,a=l),l=sr(t,a);var u=sr(t,r);l&&u&&(1!==e.rangeCount||e.anchorNode!==l.node||e.anchorOffset!==l.offset||e.focusNode!==u.node||e.focusOffset!==u.offset)&&((n=n.createRange()).setStart(l.node,l.offset),e.removeAllRanges(),a>r?(e.addRange(n),e.extend(u.node,u.offset)):(n.setEnd(u.node,u.offset),e.addRange(n)))}for(n=[],e=t;e=e.parentNode;)1===e.nodeType&&n.push({element:e,left:e.scrollLeft,top:e.scrollTop});for("function"==typeof t.focus&&t.focus(),t=0;t=document.documentMode,hr=null,gr=null,vr=null,yr=!1;function br(e,n,t){var r=t.window===t?t.document:9===t.nodeType?t:t.ownerDocument;yr||null==hr||hr!==Y(r)||("selectionStart"in(r=hr)&&dr(r)?r={start:r.selectionStart,end:r.selectionEnd}:r={anchorNode:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset},vr&&or(vr,r)||(vr=r,0<(r=$r(gr,"onSelect")).length&&(n=new ot("onSelect","select",null,n,t),e.push({event:n,listeners:r}),n.target=hr)))}function wr(e,n){var t={};return t[e.toLowerCase()]=n.toLowerCase(),t["Webkit"+e]="webkit"+n,t["Moz"+e]="moz"+n,t}var kr={animationend:wr("Animation","AnimationEnd"),animationiteration:wr("Animation","AnimationIteration"),animationstart:wr("Animation","AnimationStart"),transitionend:wr("Transition","TransitionEnd")},Sr={},xr={};function Er(e){if(Sr[e])return Sr[e];if(!kr[e])return e;var n,t=kr[e];for(n in t)if(t.hasOwnProperty(n)&&n in xr)return Sr[e]=t[n];return e}u&&(xr=document.createElement("div").style,"AnimationEvent"in window||(delete kr.animationend.animation,delete kr.animationiteration.animation,delete kr.animationstart.animation),"TransitionEvent"in window||delete kr.transitionend.transition);var Cr=Er("animationend"),zr=Er("animationiteration"),Nr=Er("animationstart"),Pr=Er("transitionend"),Lr=new Map,Tr="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Mr(e,n){Lr.set(e,n),l(n,[e])}for(var Fr=0;Frxl||(e.current=Sl[xl],Sl[xl]=null,xl--)}function _l(e,n){xl++,Sl[xl]=e.current,e.current=n}var zl={},Nl=El(zl),Pl=El(!1),Ll=zl;function Tl(e,n){var t=e.type.contextTypes;if(!t)return zl;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===n)return r.__reactInternalMemoizedMaskedChildContext;var l,a={};for(l in t)a[l]=n[l];return r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=n,e.__reactInternalMemoizedMaskedChildContext=a),a}function Ml(e){return null!=(e=e.childContextTypes)}function Fl(){Cl(Pl),Cl(Nl)}function Rl(e,t,r){if(Nl.current!==zl)throw Error(n(168));_l(Nl,t),_l(Pl,r)}function Dl(e,t,r){var l=e.stateNode;if(t=t.childContextTypes,"function"!=typeof l.getChildContext)return r;for(var a in l=l.getChildContext())if(!(a in t))throw Error(n(108,Q(e)||"Unknown",a));return O({},r,l)}function Il(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||zl,Ll=Nl.current,_l(Nl,e),_l(Pl,Pl.current),!0}function Ol(e,t,r){var l=e.stateNode;if(!l)throw Error(n(169));r?(e=Dl(e,t,Ll),l.__reactInternalMemoizedMergedChildContext=e,Cl(Pl),Cl(Nl),_l(Nl,e)):Cl(Pl),_l(Pl,r)}var Ul=null,Vl=!1,Al=!1;function Bl(e){null===Ul?Ul=[e]:Ul.push(e)}function Hl(e){Vl=!0,Bl(e)}function Ql(){if(!Al&&null!==Ul){Al=!0;var e=0,n=gn;try{var t=Ul;for(gn=1;e>=u,l-=u,Gl=1<<32-en(n)+l|t<g?(v=d,d=null):v=d.sibling;var y=m(n,d,o[g],s);if(null===y){null===d&&(d=v);break}e&&d&&null===y.alternate&&t(n,d),a=u(y,a,g),null===f?c=y:f.sibling=y,f=y,d=v}if(g===o.length)return r(n,d),aa&&Jl(n,g),c;if(null===d){for(;gv?(y=g,g=null):y=g.sibling;var w=m(a,g,b.value,c);if(null===w){null===g&&(g=y);break}e&&g&&null===w.alternate&&t(a,g),o=u(w,o,v),null===d?f=w:d.sibling=w,d=w,g=y}if(b.done)return r(a,g),aa&&Jl(a,v),f;if(null===g){for(;!b.done;v++,b=s.next())null!==(b=p(a,b.value,c))&&(o=u(b,o,v),null===d?f=b:d.sibling=b,d=b);return aa&&Jl(a,v),f}for(g=l(a,g);!b.done;v++,b=s.next())null!==(b=h(g,a,v,b.value,c))&&(e&&null!==b.alternate&&g.delete(null===b.key?v:b.key),o=u(b,o,v),null===d?f=b:d.sibling=b,d=b);return e&&g.forEach((function(e){return t(a,e)})),aa&&Jl(a,v),f}return function e(n,l,u,s){if("object"==typeof u&&null!==u&&u.type===x&&null===u.key&&(u=u.props.children),"object"==typeof u&&null!==u){switch(u.$$typeof){case k:e:{for(var c=u.key,f=l;null!==f;){if(f.key===c){if((c=u.type)===x){if(7===f.tag){r(n,f.sibling),(l=a(f,u.props.children)).return=n,n=l;break e}}else if(f.elementType===c||"object"==typeof c&&null!==c&&c.$$typeof===M&&Xa(c)===f.type){r(n,f.sibling),(l=a(f,u.props)).ref=qa(n,f,u),l.return=n,n=l;break e}r(n,f);break}t(n,f),f=f.sibling}u.type===x?((l=Ws(u.props.children,n.mode,s,u.key)).return=n,n=l):((s=Qs(u.type,u.key,u.props,null,n.mode,s)).ref=qa(n,l,u),s.return=n,n=s)}return o(n);case S:e:{for(f=u.key;null!==l;){if(l.key===f){if(4===l.tag&&l.stateNode.containerInfo===u.containerInfo&&l.stateNode.implementation===u.implementation){r(n,l.sibling),(l=a(l,u.children||[])).return=n,n=l;break e}r(n,l);break}t(n,l),l=l.sibling}(l=Ks(u,n.mode,s)).return=n,n=l}return o(n);case M:return e(n,l,(f=u._init)(u._payload),s)}if(te(u))return g(n,l,u,s);if(D(u))return v(n,l,u,s);Ya(n,u)}return"string"==typeof u&&""!==u||"number"==typeof u?(u=""+u,null!==l&&6===l.tag?(r(n,l.sibling),(l=a(l,u)).return=n,n=l):(r(n,l),(l=$s(u,n.mode,s)).return=n,n=l),o(n)):r(n,l)}}var Za=Ga(!0),Ja=Ga(!1),eu={},nu=El(eu),tu=El(eu),ru=El(eu);function lu(e){if(e===eu)throw Error(n(174));return e}function au(e,n){switch(_l(ru,n),_l(tu,e),_l(nu,eu),e=n.nodeType){case 9:case 11:n=(n=n.documentElement)?n.namespaceURI:se(null,"");break;default:n=se(n=(e=8===e?n.parentNode:n).namespaceURI||null,e=e.tagName)}Cl(nu),_l(nu,n)}function uu(){Cl(nu),Cl(tu),Cl(ru)}function ou(e){lu(ru.current);var n=lu(nu.current),t=se(n,e.type);n!==t&&(_l(tu,e),_l(nu,t))}function iu(e){tu.current===e&&(Cl(nu),Cl(tu))}var su=El(0);function cu(e){for(var n=e;null!==n;){if(13===n.tag){var t=n.memoizedState;if(null!==t&&(null===(t=t.dehydrated)||"$?"===t.data||"$!"===t.data))return n}else if(19===n.tag&&void 0!==n.memoizedProps.revealOrder){if(128&n.flags)return n}else if(null!==n.child){n.child.return=n,n=n.child;continue}if(n===e)break;for(;null===n.sibling;){if(null===n.return||n.return===e)return null;n=n.return}n.sibling.return=n.return,n=n.sibling}return null}var fu=[];function du(){for(var e=0;et?t:4,e(!0);var r=mu.transition;mu.transition={};try{e(!1),n()}finally{gn=t,mu.transition=r}}function no(){return Nu().memoizedState}function to(e,n,t){var r=os(e);if(t={lane:r,action:t,hasEagerState:!1,eagerState:null,next:null},lo(e))ao(n,t);else if(null!==(t=La(e,n,t,r))){is(t,e,r,us()),uo(t,n,r)}}function ro(e,n,t){var r=os(e),l={lane:r,action:t,hasEagerState:!1,eagerState:null,next:null};if(lo(e))ao(n,l);else{var a=e.alternate;if(0===e.lanes&&(null===a||0===a.lanes)&&null!==(a=n.lastRenderedReducer))try{var u=n.lastRenderedState,o=a(u,t);if(l.hasEagerState=!0,l.eagerState=o,ur(o,u)){var s=n.interleaved;return null===s?(l.next=l,Pa(n)):(l.next=s.next,s.next=l),void(n.interleaved=l)}}catch(e){}null!==(t=La(e,n,l,r))&&(is(t,e,r,l=us()),uo(t,n,r))}}function lo(e){var n=e.alternate;return e===gu||null!==n&&n===gu}function ao(e,n){wu=bu=!0;var t=e.pending;null===t?n.next=n:(n.next=t.next,t.next=n),e.pending=n}function uo(e,n,t){if(4194240&t){var r=n.lanes;t|=r&=e.pendingLanes,n.lanes=t,hn(e,t)}}var oo={readContext:za,useCallback:xu,useContext:xu,useEffect:xu,useImperativeHandle:xu,useInsertionEffect:xu,useLayoutEffect:xu,useMemo:xu,useReducer:xu,useRef:xu,useState:xu,useDebugValue:xu,useDeferredValue:xu,useTransition:xu,useMutableSource:xu,useSyncExternalStore:xu,useId:xu,unstable_isNewReconciler:!1},io={readContext:za,useCallback:function(e,n){return zu().memoizedState=[e,void 0===n?null:n],e},useContext:za,useEffect:Wu,useImperativeHandle:function(e,n,t){return t=null!=t?t.concat([e]):null,Hu(4194308,4,qu.bind(null,n,e),t)},useLayoutEffect:function(e,n){return Hu(4194308,4,e,n)},useInsertionEffect:function(e,n){return Hu(4,2,e,n)},useMemo:function(e,n){var t=zu();return n=void 0===n?null:n,e=e(),t.memoizedState=[e,n],e},useReducer:function(e,n,t){var r=zu();return n=void 0!==t?t(n):n,r.memoizedState=r.baseState=n,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:n},r.queue=e,e=e.dispatch=to.bind(null,gu,e),[r.memoizedState,e]},useRef:function(e){return e={current:e},zu().memoizedState=e},useState:Vu,useDebugValue:Xu,useDeferredValue:function(e){return zu().memoizedState=e},useTransition:function(){var e=Vu(!1),n=e[0];return e=eo.bind(null,e[1]),zu().memoizedState=e,[n,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var l=gu,a=zu();if(aa){if(void 0===r)throw Error(n(407));r=r()}else{if(r=t(),null===Di)throw Error(n(349));30&hu||Ru(l,t,r)}a.memoizedState=r;var u={value:r,getSnapshot:t};return a.queue=u,Wu(Iu.bind(null,l,u,e),[e]),l.flags|=2048,Au(9,Du.bind(null,l,u,r,t),void 0,null),r},useId:function(){var e=zu(),n=Di.identifierPrefix;if(aa){var t=Zl;n=":"+n+"R"+(t=(Gl&~(1<<32-en(Gl)-1)).toString(32)+t),0<(t=ku++)&&(n+="H"+t.toString(32)),n+=":"}else n=":"+n+"r"+(t=Su++).toString(32)+":";return e.memoizedState=n},unstable_isNewReconciler:!1},so={readContext:za,useCallback:Gu,useContext:za,useEffect:ju,useImperativeHandle:Yu,useInsertionEffect:$u,useLayoutEffect:Ku,useMemo:Zu,useReducer:Lu,useRef:Bu,useState:function(){return Lu(Pu)},useDebugValue:Xu,useDeferredValue:function(e){return Ju(Nu(),vu.memoizedState,e)},useTransition:function(){return[Lu(Pu)[0],Nu().memoizedState]},useMutableSource:Mu,useSyncExternalStore:Fu,useId:no,unstable_isNewReconciler:!1},co={readContext:za,useCallback:Gu,useContext:za,useEffect:ju,useImperativeHandle:Yu,useInsertionEffect:$u,useLayoutEffect:Ku,useMemo:Zu,useReducer:Tu,useRef:Bu,useState:function(){return Tu(Pu)},useDebugValue:Xu,useDeferredValue:function(e){var n=Nu();return null===vu?n.memoizedState=e:Ju(n,vu.memoizedState,e)},useTransition:function(){return[Tu(Pu)[0],Nu().memoizedState]},useMutableSource:Mu,useSyncExternalStore:Fu,useId:no,unstable_isNewReconciler:!1};function fo(e,n){try{var t="",r=n;do{t+=B(r),r=r.return}while(r);var l=t}catch(e){l="\nError generating stack: "+e.message+"\n"+e.stack}return{value:e,source:n,stack:l,digest:null}}function po(e,n,t){return{value:e,source:null,stack:null!=t?t:null,digest:null!=n?n:null}}function mo(e,n){try{console.error(n.value)}catch(e){setTimeout((function(){throw e}))}}var ho="function"==typeof WeakMap?WeakMap:Map;function go(e,n,t){(t=Da(-1,t)).tag=3,t.payload={element:null};var r=n.value;return t.callback=function(){Xi||(Xi=!0,Gi=r),mo(0,n)},t}function vo(e,n,t){(t=Da(-1,t)).tag=3;var r=e.type.getDerivedStateFromError;if("function"==typeof r){var l=n.value;t.payload=function(){return r(l)},t.callback=function(){mo(0,n)}}var a=e.stateNode;return null!==a&&"function"==typeof a.componentDidCatch&&(t.callback=function(){mo(0,n),"function"!=typeof r&&(null===Zi?Zi=new Set([this]):Zi.add(this));var e=n.stack;this.componentDidCatch(n.value,{componentStack:null!==e?e:""})}),t}function yo(e,n,t){var r=e.pingCache;if(null===r){r=e.pingCache=new ho;var l=new Set;r.set(n,l)}else void 0===(l=r.get(n))&&(l=new Set,r.set(n,l));l.has(t)||(l.add(t),e=Fs.bind(null,e,n,t),n.then(e,e))}function bo(e){do{var n;if((n=13===e.tag)&&(n=null===(n=e.memoizedState)||null!==n.dehydrated),n)return e;e=e.return}while(null!==e);return null}function wo(e,n,t,r,l){return 1&e.mode?(e.flags|=65536,e.lanes=l,e):(e===n?e.flags|=65536:(e.flags|=128,t.flags|=131072,t.flags&=-52805,1===t.tag&&(null===t.alternate?t.tag=17:((n=Da(-1,1)).tag=2,Ia(t,n,1))),t.lanes|=1),e)}var ko=w.ReactCurrentOwner,So=!1;function xo(e,n,t,r){n.child=null===e?Ja(n,null,t,r):Za(n,e.child,t,r)}function Eo(e,n,t,r,l){t=t.render;var a=n.ref;return Ca(n,l),r=Cu(e,n,t,r,a,l),t=_u(),null===e||So?(aa&&t&&na(n),n.flags|=1,xo(e,n,r,l),n.child):(n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~l,qo(e,n,l))}function Co(e,n,t,r,l){if(null===e){var a=t.type;return"function"!=typeof a||As(a)||void 0!==a.defaultProps||null!==t.compare||void 0!==t.defaultProps?((e=Qs(t.type,null,r,n,n.mode,l)).ref=n.ref,e.return=n,n.child=e):(n.tag=15,n.type=a,_o(e,n,a,r,l))}if(a=e.child,!(e.lanes&l)){var u=a.memoizedProps;if((t=null!==(t=t.compare)?t:or)(u,r)&&e.ref===n.ref)return qo(e,n,l)}return n.flags|=1,(e=Hs(a,r)).ref=n.ref,e.return=n,n.child=e}function _o(e,n,t,r,l){if(null!==e){var a=e.memoizedProps;if(or(a,r)&&e.ref===n.ref){if(So=!1,n.pendingProps=r=a,!(e.lanes&l))return n.lanes=e.lanes,qo(e,n,l);131072&e.flags&&(So=!0)}}return Po(e,n,t,r,l)}function zo(e,n,t){var r=n.pendingProps,l=r.children,a=null!==e?e.memoizedState:null;if("hidden"===r.mode)if(1&n.mode){if(!(1073741824&t))return e=null!==a?a.baseLanes|t:t,n.lanes=n.childLanes=1073741824,n.memoizedState={baseLanes:e,cachePool:null,transitions:null},n.updateQueue=null,_l(Vi,Ui),Ui|=e,null;n.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=null!==a?a.baseLanes:t,_l(Vi,Ui),Ui|=r}else n.memoizedState={baseLanes:0,cachePool:null,transitions:null},_l(Vi,Ui),Ui|=t;else null!==a?(r=a.baseLanes|t,n.memoizedState=null):r=t,_l(Vi,Ui),Ui|=r;return xo(e,n,l,t),n.child}function No(e,n){var t=n.ref;(null===e&&null!==t||null!==e&&e.ref!==t)&&(n.flags|=512,n.flags|=2097152)}function Po(e,n,t,r,l){var a=Ml(t)?Ll:Nl.current;return a=Tl(n,a),Ca(n,l),t=Cu(e,n,t,r,a,l),r=_u(),null===e||So?(aa&&r&&na(n),n.flags|=1,xo(e,n,t,l),n.child):(n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~l,qo(e,n,l))}function Lo(e,n,t,r,l){if(Ml(t)){var a=!0;Il(n)}else a=!1;if(Ca(n,l),null===n.stateNode)Ko(e,n),ja(n,t,r),Ka(n,t,r,l),r=!0;else if(null===e){var u=n.stateNode,o=n.memoizedProps;u.props=o;var s=u.context,c=t.contextType;"object"==typeof c&&null!==c?c=za(c):c=Tl(n,c=Ml(t)?Ll:Nl.current);var f=t.getDerivedStateFromProps,d="function"==typeof f||"function"==typeof u.getSnapshotBeforeUpdate;d||"function"!=typeof u.UNSAFE_componentWillReceiveProps&&"function"!=typeof u.componentWillReceiveProps||(o!==r||s!==c)&&$a(n,u,r,c),Ma=!1;var p=n.memoizedState;u.state=p,Va(n,r,u,l),s=n.memoizedState,o!==r||p!==s||Pl.current||Ma?("function"==typeof f&&(Ha(n,t,f,r),s=n.memoizedState),(o=Ma||Wa(n,t,o,r,p,s,c))?(d||"function"!=typeof u.UNSAFE_componentWillMount&&"function"!=typeof u.componentWillMount||("function"==typeof u.componentWillMount&&u.componentWillMount(),"function"==typeof u.UNSAFE_componentWillMount&&u.UNSAFE_componentWillMount()),"function"==typeof u.componentDidMount&&(n.flags|=4194308)):("function"==typeof u.componentDidMount&&(n.flags|=4194308),n.memoizedProps=r,n.memoizedState=s),u.props=r,u.state=s,u.context=c,r=o):("function"==typeof u.componentDidMount&&(n.flags|=4194308),r=!1)}else{u=n.stateNode,Ra(e,n),o=n.memoizedProps,c=n.type===n.elementType?o:va(n.type,o),u.props=c,d=n.pendingProps,p=u.context,"object"==typeof(s=t.contextType)&&null!==s?s=za(s):s=Tl(n,s=Ml(t)?Ll:Nl.current);var m=t.getDerivedStateFromProps;(f="function"==typeof m||"function"==typeof u.getSnapshotBeforeUpdate)||"function"!=typeof u.UNSAFE_componentWillReceiveProps&&"function"!=typeof u.componentWillReceiveProps||(o!==d||p!==s)&&$a(n,u,r,s),Ma=!1,p=n.memoizedState,u.state=p,Va(n,r,u,l);var h=n.memoizedState;o!==d||p!==h||Pl.current||Ma?("function"==typeof m&&(Ha(n,t,m,r),h=n.memoizedState),(c=Ma||Wa(n,t,c,r,p,h,s)||!1)?(f||"function"!=typeof u.UNSAFE_componentWillUpdate&&"function"!=typeof u.componentWillUpdate||("function"==typeof u.componentWillUpdate&&u.componentWillUpdate(r,h,s),"function"==typeof u.UNSAFE_componentWillUpdate&&u.UNSAFE_componentWillUpdate(r,h,s)),"function"==typeof u.componentDidUpdate&&(n.flags|=4),"function"==typeof u.getSnapshotBeforeUpdate&&(n.flags|=1024)):("function"!=typeof u.componentDidUpdate||o===e.memoizedProps&&p===e.memoizedState||(n.flags|=4),"function"!=typeof u.getSnapshotBeforeUpdate||o===e.memoizedProps&&p===e.memoizedState||(n.flags|=1024),n.memoizedProps=r,n.memoizedState=h),u.props=r,u.state=h,u.context=s,r=c):("function"!=typeof u.componentDidUpdate||o===e.memoizedProps&&p===e.memoizedState||(n.flags|=4),"function"!=typeof u.getSnapshotBeforeUpdate||o===e.memoizedProps&&p===e.memoizedState||(n.flags|=1024),r=!1)}return To(e,n,t,r,a,l)}function To(e,n,t,r,l,a){No(e,n);var u=!!(128&n.flags);if(!r&&!u)return l&&Ol(n,t,!1),qo(e,n,a);r=n.stateNode,ko.current=n;var o=u&&"function"!=typeof t.getDerivedStateFromError?null:r.render();return n.flags|=1,null!==e&&u?(n.child=Za(n,e.child,null,a),n.child=Za(n,null,o,a)):xo(e,n,o,a),n.memoizedState=r.state,l&&Ol(n,t,!0),n.child}function Mo(e){var n=e.stateNode;n.pendingContext?Rl(0,n.pendingContext,n.pendingContext!==n.context):n.context&&Rl(0,n.context,!1),au(e,n.containerInfo)}function Fo(e,n,t,r,l){return ma(),ha(l),n.flags|=256,xo(e,n,t,r),n.child}var Ro,Do,Io,Oo,Uo={dehydrated:null,treeContext:null,retryLane:0};function Vo(e){return{baseLanes:e,cachePool:null,transitions:null}}function Ao(e,n,t){var r,l=n.pendingProps,a=su.current,u=!1,o=!!(128&n.flags);if((r=o)||(r=(null===e||null!==e.memoizedState)&&!!(2&a)),r?(u=!0,n.flags&=-129):null!==e&&null===e.memoizedState||(a|=1),_l(su,1&a),null===e)return ca(n),null!==(e=n.memoizedState)&&null!==(e=e.dehydrated)?(1&n.mode?"$!"===e.data?n.lanes=8:n.lanes=1073741824:n.lanes=1,null):(o=l.children,e=l.fallback,u?(l=n.mode,u=n.child,o={mode:"hidden",children:o},1&l||null===u?u=js(o,l,0,null):(u.childLanes=0,u.pendingProps=o),e=Ws(e,l,t,null),u.return=n,e.return=n,u.sibling=e,n.child=u,n.child.memoizedState=Vo(t),n.memoizedState=Uo,e):Bo(n,o));if(null!==(a=e.memoizedState)&&null!==(r=a.dehydrated))return Qo(e,n,o,l,r,a,t);if(u){u=l.fallback,o=n.mode,r=(a=e.child).sibling;var s={mode:"hidden",children:l.children};return 1&o||n.child===a?(l=Hs(a,s)).subtreeFlags=14680064&a.subtreeFlags:((l=n.child).childLanes=0,l.pendingProps=s,n.deletions=null),null!==r?u=Hs(r,u):(u=Ws(u,o,t,null)).flags|=2,u.return=n,l.return=n,l.sibling=u,n.child=l,l=u,u=n.child,o=null===(o=e.child.memoizedState)?Vo(t):{baseLanes:o.baseLanes|t,cachePool:null,transitions:o.transitions},u.memoizedState=o,u.childLanes=e.childLanes&~t,n.memoizedState=Uo,l}return e=(u=e.child).sibling,l=Hs(u,{mode:"visible",children:l.children}),!(1&n.mode)&&(l.lanes=t),l.return=n,l.sibling=null,null!==e&&(null===(t=n.deletions)?(n.deletions=[e],n.flags|=16):t.push(e)),n.child=l,n.memoizedState=null,l}function Bo(e,n){return(n=js({mode:"visible",children:n},e.mode,0,null)).return=e,e.child=n}function Ho(e,n,t,r){return null!==r&&ha(r),Za(n,e.child,null,t),(e=Bo(n,n.pendingProps.children)).flags|=2,n.memoizedState=null,e}function Qo(e,t,r,l,a,u,o){if(r)return 256&t.flags?(t.flags&=-257,Ho(e,t,o,l=po(Error(n(422))))):null!==t.memoizedState?(t.child=e.child,t.flags|=128,null):(u=l.fallback,a=t.mode,l=js({mode:"visible",children:l.children},a,0,null),(u=Ws(u,a,o,null)).flags|=2,l.return=t,u.return=t,l.sibling=u,t.child=l,1&t.mode&&Za(t,e.child,null,o),t.child.memoizedState=Vo(o),t.memoizedState=Uo,u);if(!(1&t.mode))return Ho(e,t,o,null);if("$!"===a.data){if(l=a.nextSibling&&a.nextSibling.dataset)var s=l.dgst;return l=s,Ho(e,t,o,l=po(u=Error(n(419)),l,void 0))}if(s=!!(o&e.childLanes),So||s){if(null!==(l=Di)){switch(o&-o){case 4:a=2;break;case 16:a=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:a=32;break;case 536870912:a=268435456;break;default:a=0}0!==(a=a&(l.suspendedLanes|o)?0:a)&&a!==u.retryLane&&(u.retryLane=a,Ta(e,a),is(l,e,a,-1))}return Ss(),Ho(e,t,o,l=po(Error(n(421))))}return"$?"===a.data?(t.flags|=128,t.child=e.child,t=Ds.bind(null,e),a._reactRetry=t,null):(e=u.treeContext,la=sl(a.nextSibling),ra=t,aa=!0,ua=null,null!==e&&(ql[Yl++]=Gl,ql[Yl++]=Zl,ql[Yl++]=Xl,Gl=e.id,Zl=e.overflow,Xl=t),(t=Bo(t,l.children)).flags|=4096,t)}function Wo(e,n,t){e.lanes|=n;var r=e.alternate;null!==r&&(r.lanes|=n),Ea(e.return,n,t)}function jo(e,n,t,r,l){var a=e.memoizedState;null===a?e.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:r,tail:t,tailMode:l}:(a.isBackwards=n,a.rendering=null,a.renderingStartTime=0,a.last=r,a.tail=t,a.tailMode=l)}function $o(e,n,t){var r=n.pendingProps,l=r.revealOrder,a=r.tail;if(xo(e,n,r.children,t),2&(r=su.current))r=1&r|2,n.flags|=128;else{if(null!==e&&128&e.flags)e:for(e=n.child;null!==e;){if(13===e.tag)null!==e.memoizedState&&Wo(e,t,n);else if(19===e.tag)Wo(e,t,n);else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===n)break e;for(;null===e.sibling;){if(null===e.return||e.return===n)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(_l(su,r),1&n.mode)switch(l){case"forwards":for(t=n.child,l=null;null!==t;)null!==(e=t.alternate)&&null===cu(e)&&(l=t),t=t.sibling;null===(t=l)?(l=n.child,n.child=null):(l=t.sibling,t.sibling=null),jo(n,!1,l,t,a);break;case"backwards":for(t=null,l=n.child,n.child=null;null!==l;){if(null!==(e=l.alternate)&&null===cu(e)){n.child=l;break}e=l.sibling,l.sibling=t,t=l,l=e}jo(n,!0,t,null,a);break;case"together":jo(n,!1,null,null,void 0);break;default:n.memoizedState=null}else n.memoizedState=null;return n.child}function Ko(e,n){!(1&n.mode)&&null!==e&&(e.alternate=null,n.alternate=null,n.flags|=2)}function qo(e,t,r){if(null!==e&&(t.dependencies=e.dependencies),Hi|=t.lanes,!(r&t.childLanes))return null;if(null!==e&&t.child!==e.child)throw Error(n(153));if(null!==t.child){for(r=Hs(e=t.child,e.pendingProps),t.child=r,r.return=t;null!==e.sibling;)e=e.sibling,(r=r.sibling=Hs(e,e.pendingProps)).return=t;r.sibling=null}return t.child}function Yo(e,n,t){switch(n.tag){case 3:Mo(n),ma();break;case 5:ou(n);break;case 1:Ml(n.type)&&Il(n);break;case 4:au(n,n.stateNode.containerInfo);break;case 10:var r=n.type._context,l=n.memoizedProps.value;_l(ya,r._currentValue),r._currentValue=l;break;case 13:if(null!==(r=n.memoizedState))return null!==r.dehydrated?(_l(su,1&su.current),n.flags|=128,null):t&n.child.childLanes?Ao(e,n,t):(_l(su,1&su.current),null!==(e=qo(e,n,t))?e.sibling:null);_l(su,1&su.current);break;case 19:if(r=!!(t&n.childLanes),128&e.flags){if(r)return $o(e,n,t);n.flags|=128}if(null!==(l=n.memoizedState)&&(l.rendering=null,l.tail=null,l.lastEffect=null),_l(su,su.current),r)break;return null;case 22:case 23:return n.lanes=0,zo(e,n,t)}return qo(e,n,t)}function Xo(e,n){if(!aa)switch(e.tailMode){case"hidden":n=e.tail;for(var t=null;null!==n;)null!==n.alternate&&(t=n),n=n.sibling;null===t?e.tail=null:t.sibling=null;break;case"collapsed":t=e.tail;for(var r=null;null!==t;)null!==t.alternate&&(r=t),t=t.sibling;null===r?n||null===e.tail?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Go(e){var n=null!==e.alternate&&e.alternate.child===e.child,t=0,r=0;if(n)for(var l=e.child;null!==l;)t|=l.lanes|l.childLanes,r|=14680064&l.subtreeFlags,r|=14680064&l.flags,l.return=e,l=l.sibling;else for(l=e.child;null!==l;)t|=l.lanes|l.childLanes,r|=l.subtreeFlags,r|=l.flags,l.return=e,l=l.sibling;return e.subtreeFlags|=r,e.childLanes=t,n}function Zo(e,t,l){var a=t.pendingProps;switch(ta(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Go(t),null;case 1:case 17:return Ml(t.type)&&Fl(),Go(t),null;case 3:return a=t.stateNode,uu(),Cl(Pl),Cl(Nl),du(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),null!==e&&null!==e.child||(da(t)?t.flags|=4:null===e||e.memoizedState.isDehydrated&&!(256&t.flags)||(t.flags|=1024,null!==ua&&(ds(ua),ua=null))),Do(e,t),Go(t),null;case 5:iu(t);var u=lu(ru.current);if(l=t.type,null!==e&&null!=t.stateNode)Io(e,t,l,a,u),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!a){if(null===t.stateNode)throw Error(n(166));return Go(t),null}if(e=lu(nu.current),da(t)){a=t.stateNode,l=t.type;var o=t.memoizedProps;switch(a[dl]=t,a[pl]=o,e=!!(1&t.mode),l){case"dialog":Vr("cancel",a),Vr("close",a);break;case"iframe":case"object":case"embed":Vr("load",a);break;case"video":case"audio":for(u=0;u<\/script>",e=e.removeChild(e.firstChild)):"string"==typeof a.is?e=s.createElement(l,{is:a.is}):(e=s.createElement(l),"select"===l&&(s=e,a.multiple?s.multiple=!0:a.size&&(s.size=a.size))):e=s.createElementNS(e,l),e[dl]=t,e[pl]=a,Ro(e,t,!1,!1),t.stateNode=e;e:{switch(s=we(l,a),l){case"dialog":Vr("cancel",e),Vr("close",e),u=a;break;case"iframe":case"object":case"embed":Vr("load",e),u=a;break;case"video":case"audio":for(u=0;uqi&&(t.flags|=128,a=!0,Xo(o,!1),t.lanes=4194304)}else{if(!a)if(null!==(e=cu(s))){if(t.flags|=128,a=!0,null!==(l=e.updateQueue)&&(t.updateQueue=l,t.flags|=4),Xo(o,!0),null===o.tail&&"hidden"===o.tailMode&&!s.alternate&&!aa)return Go(t),null}else 2*_r(_d[1]).unstable_now()-o.renderingStartTime>qi&&1073741824!==l&&(t.flags|=128,a=!0,Xo(o,!1),t.lanes=4194304);o.isBackwards?(s.sibling=t.child,t.child=s):(null!==(l=o.last)?l.sibling=s:t.child=s,o.last=s)}return null!==o.tail?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=_r(_d[1]).unstable_now(),t.sibling=null,l=su.current,_l(su,a?1&l|2:1&l),t):(Go(t),null);case 22:case 23:return ys(),a=null!==t.memoizedState,null!==e&&null!==e.memoizedState!==a&&(t.flags|=8192),a&&1&t.mode?!!(1073741824&Ui)&&(Go(t),6&t.subtreeFlags&&(t.flags|=8192)):Go(t),null;case 24:case 25:return null}throw Error(n(156,t.tag))}function Jo(e,t){switch(ta(t),t.tag){case 1:return Ml(t.type)&&Fl(),65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 3:return uu(),Cl(Pl),Cl(Nl),du(),65536&(e=t.flags)&&!(128&e)?(t.flags=-65537&e|128,t):null;case 5:return iu(t),null;case 13:if(Cl(su),null!==(e=t.memoizedState)&&null!==e.dehydrated){if(null===t.alternate)throw Error(n(340));ma()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 19:return Cl(su),null;case 4:return uu(),null;case 10:return xa(t.type._context),null;case 22:case 23:return ys(),null;default:return null}}Ro=function(e,n){for(var t=n.child;null!==t;){if(5===t.tag||6===t.tag)e.appendChild(t.stateNode);else if(4!==t.tag&&null!==t.child){t.child.return=t,t=t.child;continue}if(t===n)break;for(;null===t.sibling;){if(null===t.return||t.return===n)return;t=t.return}t.sibling.return=t.return,t=t.sibling}},Do=function(){},Io=function(e,n,t,l){var a=e.memoizedProps;if(a!==l){e=n.stateNode,lu(nu.current);var u,o=null;switch(t){case"input":a=X(e,a),l=X(e,l),o=[];break;case"select":a=O({},a,{value:void 0}),l=O({},l,{value:void 0}),o=[];break;case"textarea":a=le(e,a),l=le(e,l),o=[];break;default:"function"!=typeof a.onClick&&"function"==typeof l.onClick&&(e.onclick=Jr)}for(f in be(t,l),t=null,a)if(!l.hasOwnProperty(f)&&a.hasOwnProperty(f)&&null!=a[f])if("style"===f){var s=a[f];for(u in s)s.hasOwnProperty(u)&&(t||(t={}),t[u]="")}else"dangerouslySetInnerHTML"!==f&&"children"!==f&&"suppressContentEditableWarning"!==f&&"suppressHydrationWarning"!==f&&"autoFocus"!==f&&(r.hasOwnProperty(f)?o||(o=[]):(o=o||[]).push(f,null));for(f in l){var c=l[f];if(s=null!=a?a[f]:void 0,l.hasOwnProperty(f)&&c!==s&&(null!=c||null!=s))if("style"===f)if(s){for(u in s)!s.hasOwnProperty(u)||c&&c.hasOwnProperty(u)||(t||(t={}),t[u]="");for(u in c)c.hasOwnProperty(u)&&s[u]!==c[u]&&(t||(t={}),t[u]=c[u])}else t||(o||(o=[]),o.push(f,t)),t=c;else"dangerouslySetInnerHTML"===f?(c=c?c.__html:void 0,s=s?s.__html:void 0,null!=c&&s!==c&&(o=o||[]).push(f,c)):"children"===f?"string"!=typeof c&&"number"!=typeof c||(o=o||[]).push(f,""+c):"suppressContentEditableWarning"!==f&&"suppressHydrationWarning"!==f&&(r.hasOwnProperty(f)?(null!=c&&"onScroll"===f&&Vr("scroll",e),o||s===c||(o=[])):(o=o||[]).push(f,c))}t&&(o=o||[]).push("style",t);var f=o;(n.updateQueue=f)&&(n.flags|=4)}},Oo=function(e,n,t,r){t!==r&&(n.flags|=4)};var ei=!1,ni=!1,ti="function"==typeof WeakSet?WeakSet:Set,ri=null;function li(e,n){var t=e.ref;if(null!==t)if("function"==typeof t)try{t(null)}catch(t){Ms(e,n,t)}else t.current=null}function ai(e,n,t){try{t()}catch(t){Ms(e,n,t)}}var ui=!1;function oi(e,t){if(el=Hn,dr(e=fr())){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{var l=(r=(r=e.ownerDocument)&&r.defaultView||window).getSelection&&r.getSelection();if(l&&0!==l.rangeCount){r=l.anchorNode;var a=l.anchorOffset,u=l.focusNode;l=l.focusOffset;try{r.nodeType,u.nodeType}catch(e){r=null;break e}var o=0,s=-1,c=-1,f=0,d=0,p=e,m=null;n:for(;;){for(var h;p!==r||0!==a&&3!==p.nodeType||(s=o+a),p!==u||0!==l&&3!==p.nodeType||(c=o+l),3===p.nodeType&&(o+=p.nodeValue.length),null!==(h=p.firstChild);)m=p,p=h;for(;;){if(p===e)break n;if(m===r&&++f===a&&(s=o),m===u&&++d===l&&(c=o),null!==(h=p.nextSibling))break;m=(p=m).parentNode}p=h}r=-1===s||-1===c?null:{start:s,end:c}}else r=null}r=r||{start:0,end:0}}else r=null;for(nl={focusedElem:e,selectionRange:r},Hn=!1,ri=t;null!==ri;)if(e=(t=ri).child,1028&t.subtreeFlags&&null!==e)e.return=t,ri=e;else for(;null!==ri;){t=ri;try{var g=t.alternate;if(1024&t.flags)switch(t.tag){case 0:case 11:case 15:case 5:case 6:case 4:case 17:break;case 1:if(null!==g){var v=g.memoizedProps,y=g.memoizedState,b=t.stateNode,w=b.getSnapshotBeforeUpdate(t.elementType===t.type?v:va(t.type,v),y);b.__reactInternalSnapshotBeforeUpdate=w}break;case 3:var k=t.stateNode.containerInfo;1===k.nodeType?k.textContent="":9===k.nodeType&&k.documentElement&&k.removeChild(k.documentElement);break;default:throw Error(n(163))}}catch(e){Ms(t,t.return,e)}if(null!==(e=t.sibling)){e.return=t.return,ri=e;break}ri=t.return}return g=ui,ui=!1,g}function ii(e,n,t){var r=n.updateQueue;if(null!==(r=null!==r?r.lastEffect:null)){var l=r=r.next;do{if((l.tag&e)===e){var a=l.destroy;l.destroy=void 0,void 0!==a&&ai(n,t,a)}l=l.next}while(l!==r)}}function si(e,n){if(null!==(n=null!==(n=n.updateQueue)?n.lastEffect:null)){var t=n=n.next;do{if((t.tag&e)===e){var r=t.create;t.destroy=r()}t=t.next}while(t!==n)}}function ci(e){var n=e.ref;if(null!==n){var t=e.stateNode;e.tag,e=t,"function"==typeof n?n(e):n.current=e}}function fi(e){var n=e.alternate;null!==n&&(e.alternate=null,fi(n)),e.child=null,e.deletions=null,e.sibling=null,5===e.tag&&(null!==(n=e.stateNode)&&(delete n[dl],delete n[pl],delete n[hl],delete n[gl],delete n[vl])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function di(e){return 5===e.tag||3===e.tag||4===e.tag}function pi(e){e:for(;;){for(;null===e.sibling;){if(null===e.return||di(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;5!==e.tag&&6!==e.tag&&18!==e.tag;){if(2&e.flags)continue e;if(null===e.child||4===e.tag)continue e;e.child.return=e,e=e.child}if(!(2&e.flags))return e.stateNode}}function mi(e,n,t){var r=e.tag;if(5===r||6===r)e=e.stateNode,n?8===t.nodeType?t.parentNode.insertBefore(e,n):t.insertBefore(e,n):(8===t.nodeType?(n=t.parentNode).insertBefore(e,t):(n=t).appendChild(e),null!=(t=t._reactRootContainer)||null!==n.onclick||(n.onclick=Jr));else if(4!==r&&null!==(e=e.child))for(mi(e,n,t),e=e.sibling;null!==e;)mi(e,n,t),e=e.sibling}function hi(e,n,t){var r=e.tag;if(5===r||6===r)e=e.stateNode,n?t.insertBefore(e,n):t.appendChild(e);else if(4!==r&&null!==(e=e.child))for(hi(e,n,t),e=e.sibling;null!==e;)hi(e,n,t),e=e.sibling}var gi=null,vi=!1;function yi(e,n,t){for(t=t.child;null!==t;)bi(e,n,t),t=t.sibling}function bi(e,n,t){if(Ze&&"function"==typeof Ze.onCommitFiberUnmount)try{Ze.onCommitFiberUnmount(Ge,t)}catch(e){}switch(t.tag){case 5:ni||li(t,n);case 6:var r=gi,l=vi;gi=null,yi(e,n,t),vi=l,null!==(gi=r)&&(vi?(e=gi,t=t.stateNode,8===e.nodeType?e.parentNode.removeChild(t):e.removeChild(t)):gi.removeChild(t.stateNode));break;case 18:null!==gi&&(vi?(e=gi,t=t.stateNode,8===e.nodeType?il(e.parentNode,t):1===e.nodeType&&il(e,t),An(e)):il(gi,t.stateNode));break;case 4:r=gi,l=vi,gi=t.stateNode.containerInfo,vi=!0,yi(e,n,t),gi=r,vi=l;break;case 0:case 11:case 14:case 15:if(!ni&&(null!==(r=t.updateQueue)&&null!==(r=r.lastEffect))){l=r=r.next;do{var a=l,u=a.destroy;a=a.tag,void 0!==u&&(2&a||4&a)&&ai(t,n,u),l=l.next}while(l!==r)}yi(e,n,t);break;case 1:if(!ni&&(li(t,n),"function"==typeof(r=t.stateNode).componentWillUnmount))try{r.props=t.memoizedProps,r.state=t.memoizedState,r.componentWillUnmount()}catch(e){Ms(t,n,e)}yi(e,n,t);break;case 21:yi(e,n,t);break;case 22:1&t.mode?(ni=(r=ni)||null!==t.memoizedState,yi(e,n,t),ni=r):yi(e,n,t);break;default:yi(e,n,t)}}function wi(e){var n=e.updateQueue;if(null!==n){e.updateQueue=null;var t=e.stateNode;null===t&&(t=e.stateNode=new ti),n.forEach((function(n){var r=Is.bind(null,e,n);t.has(n)||(t.add(n),n.then(r,r))}))}}function ki(e,t){var r=t.deletions;if(null!==r)for(var l=0;la&&(a=o),l&=~u}if(l=a,10<(l=(120>(l=_r(_d[1]).unstable_now()-l)?120:480>l?480:1080>l?1080:1920>l?1920:3e3>l?3e3:4320>l?4320:1960*Li(l/1960))-l)){e.timeoutHandle=rl(Ns.bind(null,e,$i,Yi),l);break}Ns(e,$i,Yi);break;default:throw Error(n(329))}}}return ss(e,_r(_d[1]).unstable_now()),e.callbackNode===r?cs.bind(null,e):null}function fs(e,n){var t=ji;return e.current.memoizedState.isDehydrated&&(bs(e,n).flags|=256),2!==(e=xs(e,n))&&(n=$i,$i=t,null!==n&&ds(n)),e}function ds(e){null===$i?$i=e:$i.push.apply($i,e)}function ps(e){for(var n=e;;){if(16384&n.flags){var t=n.updateQueue;if(null!==t&&null!==(t=t.stores))for(var r=0;re?16:e,null===es)var l=!1;else{if(e=es,es=null,ns=0,6&Ri)throw Error(n(331));var a=Ri;for(Ri|=4,ri=e.current;null!==ri;){var u=ri,o=u.child;if(16&ri.flags){var s=u.deletions;if(null!==s){for(var c=0;c_r(_d[1]).unstable_now()-Ki?bs(e,0):Wi|=t),ss(e,n)}function Rs(e,n){0===n&&(1&e.mode?(n=ln,!(130023424&(ln<<=1))&&(ln=4194304)):n=1);var t=us();null!==(e=Ta(e,n))&&(pn(e,n,t),ss(e,t))}function Ds(e){var n=e.memoizedState,t=0;null!==n&&(t=n.retryLane),Rs(e,t)}function Is(e,t){var r=0;switch(e.tag){case 13:var l=e.stateNode,a=e.memoizedState;null!==a&&(r=a.retryLane);break;case 19:l=e.stateNode;break;default:throw Error(n(314))}null!==l&&l.delete(t),Rs(e,r)}function Os(e,n){return _r(_d[1]).unstable_scheduleCallback(e,n)}function Us(e,n,t,r){this.tag=e,this.key=t,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=n,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Vs(e,n,t,r){return new Us(e,n,t,r)}function As(e){return!(!(e=e.prototype)||!e.isReactComponent)}function Bs(e){if("function"==typeof e)return As(e)?1:0;if(null!=e){if((e=e.$$typeof)===N)return 11;if(e===T)return 14}return 2}function Hs(e,n){var t=e.alternate;return null===t?((t=Vs(e.tag,n,e.key,e.mode)).elementType=e.elementType,t.type=e.type,t.stateNode=e.stateNode,t.alternate=e,e.alternate=t):(t.pendingProps=n,t.type=e.type,t.flags=0,t.subtreeFlags=0,t.deletions=null),t.flags=14680064&e.flags,t.childLanes=e.childLanes,t.lanes=e.lanes,t.child=e.child,t.memoizedProps=e.memoizedProps,t.memoizedState=e.memoizedState,t.updateQueue=e.updateQueue,n=e.dependencies,t.dependencies=null===n?null:{lanes:n.lanes,firstContext:n.firstContext},t.sibling=e.sibling,t.index=e.index,t.ref=e.ref,t}function Qs(e,t,r,l,a,u){var o=2;if(l=e,"function"==typeof e)As(e)&&(o=1);else if("string"==typeof e)o=5;else e:switch(e){case x:return Ws(r.children,a,u,t);case E:o=8,a|=8;break;case C:return(e=Vs(12,r,t,2|a)).elementType=C,e.lanes=u,e;case P:return(e=Vs(13,r,t,a)).elementType=P,e.lanes=u,e;case L:return(e=Vs(19,r,t,a)).elementType=L,e.lanes=u,e;case F:return js(r,a,u,t);default:if("object"==typeof e&&null!==e)switch(e.$$typeof){case _:o=10;break e;case z:o=9;break e;case N:o=11;break e;case T:o=14;break e;case M:o=16,l=null;break e}throw Error(n(130,null==e?e:typeof e,""))}return(t=Vs(o,r,t,a)).elementType=e,t.type=l,t.lanes=u,t}function Ws(e,n,t,r){return(e=Vs(7,e,r,n)).lanes=t,e}function js(e,n,t,r){return(e=Vs(22,e,r,n)).elementType=F,e.lanes=t,e.stateNode={isHidden:!1},e}function $s(e,n,t){return(e=Vs(6,e,null,n)).lanes=t,e}function Ks(e,n,t){return(n=Vs(4,null!==e.children?e.children:[],e.key,n)).lanes=t,n.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},n}function qs(e,n,t,r,l){this.tag=n,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=dn(0),this.expirationTimes=dn(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=dn(0),this.identifierPrefix=r,this.onRecoverableError=l,this.mutableSourceEagerHydrationData=null}function Ys(e,n,t,r,l,a,u,o,s){return e=new qs(e,n,t,o,s),1===n?(n=1,!0===a&&(n|=8)):n=0,a=Vs(3,null,null,n),e.current=a,a.stateNode=e,a.memoizedState={element:r,isDehydrated:t,cache:null,transitions:null,pendingSuspenseBoundaries:null},Fa(a),e}function Xs(e,n,t){var r=3>>1,l=n[r];if(!(0>>1;ra(s,t))ca(f,s)?(n[r]=f,n[c]=t,r=c):(n[r]=s,n[o]=t,r=o);else{if(!(ca(f,t)))break n;n[r]=f,n[c]=t,r=c}}}return e}function a(n,e){var t=n.sortIndex-e.sortIndex;return 0!==t?t:n.id-e.id}if("object"==typeof performance&&"function"==typeof performance.now){var r=performance;_e.unstable_now=function(){return r.now()}}else{var l=Date,u=l.now();_e.unstable_now=function(){return l.now()-u}}var o=[],s=[],c=1,f=null,b=3,d=!1,v=!1,p=!1,y="function"==typeof setTimeout?setTimeout:null,m="function"==typeof clearTimeout?clearTimeout:null,_="undefined"!=typeof setImmediate?setImmediate:null;function g(a){for(var r=e(s);null!==r;){if(null===r.callback)t(s);else{if(!(r.startTime<=a))break;t(s),r.sortIndex=r.expirationTime,n(o,r)}r=e(s)}}function h(n){if(p=!1,g(n),!v)if(null!==e(o))v=!0,E(k);else{var t=e(s);null!==t&&N(h,t.startTime-n)}}function k(n,a){v=!1,p&&(p=!1,m(T),T=-1),d=!0;var r=b;try{for(g(a),f=e(o);null!==f&&(!(f.expirationTime>a)||n&&!L());){var l=f.callback;if("function"==typeof l){f.callback=null,b=f.priorityLevel;var u=l(f.expirationTime<=a);a=_e.unstable_now(),"function"==typeof u?f.callback=u:f===e(o)&&t(o),g(a)}else t(o);f=e(o)}if(null!==f)var c=!0;else{var y=e(s);null!==y&&N(h,y.startTime-a),c=!1}return c}finally{f=null,b=r,d=!1}}"undefined"!=typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);var w,x=!1,I=null,T=-1,P=5,C=-1;function L(){return!(_e.unstable_now()-Cn||125l?(t.sortIndex=r,n(s,t),null===e(o)&&t===e(s)&&(p?(m(T),T=-1):p=!0,N(h,r-l))):(t.sortIndex=u,n(o,t),v||d||(v=!0,E(k))),t},_e.unstable_shouldYield=L,_e.unstable_wrapCallback=function(n){var e=b;return function(){var t=b;b=e;try{return n.apply(this,arguments)}finally{b=t}}}}),17,[]); -__d((function(g,_r,_i,_a,m,_e,d){var e=_r(d[0]);Object.defineProperty(_e,"__esModule",{value:!0}),_e.default=function(e,t,o,l){var f=l.hydrate,c=l.initialProps,i=l.mode,p=l.rootTag,y=f?'concurrent'===i?a.hydrate:a.hydrateLegacy:'concurrent'===i?a.render:a.default;return(0,n.default)(p,'Expect to have a valid rootTag, instead got ',p),y(u.default.createElement(r.default,{WrapperComponent:t,ref:o,rootTag:p},u.default.createElement(e,c)),p)},_e.getApplication=function(e,n,a){return{element:u.default.createElement(r.default,{WrapperComponent:a,rootTag:{}},u.default.createElement(e,n)),getStyleElement:e=>{var r=o.default.getSheet();return u.default.createElement("style",(0,t.default)({},e,{dangerouslySetInnerHTML:{__html:r.textContent},id:r.id}))}}};var t=e(_r(d[1])),r=e(_r(d[2])),n=e(_r(d[3])),a=(function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=l(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&{}.hasOwnProperty.call(e,o)){var u=a?Object.getOwnPropertyDescriptor(e,o):null;u&&(u.get||u.set)?Object.defineProperty(n,o,u):n[o]=e[o]}return n.default=e,r&&r.set(e,n),n})(_r(d[4])),o=e(_r(d[5])),u=e(_r(d[6]));function l(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(l=function(e){return e?r:t})(e)}}),18,[1,19,20,10,21,27,14]); -__d((function(g,_r,i,a,m,_e,d){function e(){return m.exports=e=Object.assign?Object.assign.bind():function(e){for(var r=1;r{b.insert(t,0)})),l.set(p,c.length),c.push(b);else{var v=l.get(p);if(null==v){var k=c[0],w=null!=k?k.getTextContent():'';b=(0,o.default)((0,u.default)(f,p,w)),l.set(p,c.length),c.push(b)}else b=c[v]}}else 0===c.length?(b=(0,o.default)((0,u.default)(f)),h.forEach((t=>{b.insert(t,0)})),c.push(b)):b=c[0];return{getTextContent:()=>b.getTextContent(),id:f,insert(t,n){c.forEach((u=>{u.insert(t,n)}))}}};var n=t(r(d[1])),u=t(r(d[2])),o=t(r(d[3])),s='react-native-stylesheet',l=new WeakMap,c=[],h=['html{-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:rgba(0,0,0,0);}','body{margin:0;}','button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0;}','input::-webkit-search-cancel-button,input::-webkit-search-decoration,input::-webkit-search-results-button,input::-webkit-search-results-decoration{display:none;}']}),22,[1,23,24,25]); -__d((function(g,r,i,a,m,e,d){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=!(!window.document||!window.document.createElement);e.default=t}),23,[]); -__d((function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,l,o){if(n.default){var u=null!=l?l:document,f=u.getElementById(t);if(null==f)if((f=document.createElement('style')).setAttribute('id',t),'string'==typeof o&&f.appendChild(document.createTextNode(o)),u instanceof ShadowRoot)u.insertBefore(f,u.firstChild);else{var s=u.head;s&&s.insertBefore(f,s.firstChild)}return f.sheet}return null};var n=t(r(d[1]))}),24,[1,23]); -__d((function(g,r,_i,_a,m,_e,d){Object.defineProperty(_e,"__esModule",{value:!0}),_e.default=function(n){var s,o={},c={};null!=n&&t.call(n.cssRules).forEach(((t,e)=>{var n=t.cssText;if(n.indexOf('stylesheet-group')>-1)s=u(t),o[s]={start:e,rules:[n]};else{var l=a(n);null!=l&&(c[l]=!0,o[s].rules.push(n))}}));function f(t,e,n){var u=l(o),s=u.indexOf(e)+1,a=u[s],c=null!=a&&null!=o[a].start?o[a].start:t.cssRules.length,f=i(t,n,c);if(f){null==o[e].start&&(o[e].start=c);for(var v=s;vl(o).map((t=>{var e=o[t].rules,n=e.shift();return e.sort(),e.unshift(n),e.join('\n')})).join('\n'),insert(t,u){var l=Number(u);if(null==o[l]){var s=e(l);o[l]={start:null,rules:[s]},null!=n&&f(n,l,s)}var i=a(t);null!=i&&null==c[i]&&(c[i]=!0,o[l].rules.push(t),null!=n&&(f(n,l,t)||o[l].rules.pop()))}}};var t=Array.prototype.slice;function e(t){return"[stylesheet-group=\""+t+"\"]{}"}var n=/["']/g;function u(t){return Number(t.selectorText.split(n)[1])}function l(t){return Object.keys(t).map(Number).sort(((t,e)=>t>e?1:-1))}var s=/\s*([,])\s*/g;function a(t){var e=t.split('{')[0].trim();return''!==e?e.replace(s,'$1'):null}function i(t,e,n){try{return t.insertRule(e,n),!0}catch(t){return!1}}}),25,[]); -__d((function(g,r,i,a,m,e,d){'use strict';e.createRoot=r(d[0]).createRoot,e.hydrateRoot=r(d[0]).hydrateRoot}),26,[12]); -__d((function(g,r,_i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=t(r(d[1])),i=t(r(d[2])),o=t(r(d[3])),l=["writingDirection"],u=new WeakMap,c=(0,r(d[4]).createSheet)(),f={shadow:!0,textShadow:!0};function s(t,o){void 0===o&&(o={});var c=o,s=c.writingDirection,v=(0,i.default)(c,l),_='rtl'===s;return r(d[5]).styleq.factory({transform(t){var i=u.get(t);return null!=i?(0,r(d[6]).localizeStyle)(i,_):(0,r(d[7]).preprocess)(t,(0,n.default)((0,n.default)({},f),v))}})(t)}function v(t){t.forEach((t=>{var n=t[0],i=t[1];null!=c&&n.forEach((t=>{c.insert(t,i)}))}))}function _(t,n){var i=(0,r(d[8]).classic)(t,n),o=i[0];return v(i[1]),o}var O={position:'absolute',left:0,right:0,top:0,bottom:0},w=h({x:(0,n.default)({},O)}).x;function h(t){return Object.keys(t).forEach((n=>{var i,o,l,c,s=t[n];null!=s&&!0!==s.$$css&&(n.indexOf('$raw')>-1?i=_(s,n.split('$raw')[0]):(o=s,l=(0,r(d[8]).atomic)((0,r(d[7]).preprocess)(o,f)),c=l[0],v(l[1]),i=c),u.set(s,i))})),t}function p(t,n){void 0===n&&(n={});var i='rtl'===n.writingDirection,o=s(t,n);return Array.isArray(o)&&null!=o[1]&&(o[1]=(0,r(d[8]).inline)(o[1],i)),o}p.absoluteFill=w,p.absoluteFillObject=O,p.create=h,p.compose=function(t,n){return[t,n]},p.flatten=function(){for(var t=arguments.length,n=new Array(t),i=0;i0;){var p=v.pop();if(null!=p&&!1!==p)if(Array.isArray(p))for(var y=0;y{var l=t.shadowColor,u=t.shadowOffset,h=t.shadowOpacity,S=t.shadowRadius,w=u||s,f=w.height,c=w.width,p=(0,n.default)(c),x=(0,n.default)(f),b=(0,n.default)(S||0),v=(0,o.default)(l||'black',h);if(null!=v&&null!=p&&null!=x&&null!=b)return p+" "+x+" "+b+" "+v};e.createBoxShadowValue=u;var h=t=>{var o=t.textShadowColor,l=t.textShadowOffset,u=t.textShadowRadius,h=l||s,S=h.height,w=h.width,f=u||0,c=(0,n.default)(w),p=(0,n.default)(S),x=(0,n.default)(f),b=(0,n.default)(o,'textShadowColor');if(b&&(0!==S||0!==w||0!==f)&&null!=c&&null!=p&&null!=x)return c+" "+p+" "+x+" "+b};e.createTextShadowValue=h;var S=t=>{var o=Object.keys(t)[0],l=t[o];return'matrix'===o||'matrix3d'===o?o+"("+l.join(',')+")":o+"("+(0,n.default)(l,o)+")"},w=t=>t.map(S).join(' ');e.createTransformValue=w;var f={borderBottomEndRadius:'borderEndEndRadius',borderBottomStartRadius:'borderEndStartRadius',borderTopEndRadius:'borderStartEndRadius',borderTopStartRadius:'borderStartStartRadius',borderEndColor:'borderInlineEndColor',borderEndStyle:'borderInlineEndStyle',borderEndWidth:'borderInlineEndWidth',borderStartColor:'borderInlineStartColor',borderStartStyle:'borderInlineStartStyle',borderStartWidth:'borderInlineStartWidth',end:'insetInlineEnd',marginEnd:'marginInlineEnd',marginHorizontal:'marginInline',marginStart:'marginInlineStart',marginVertical:'marginBlock',paddingEnd:'paddingInlineEnd',paddingHorizontal:'paddingInline',paddingStart:'paddingInlineStart',paddingVertical:'paddingBlock',start:'insetInlineStart'},c={elevation:!0,overlayColor:!0,resizeMode:!0,tintColor:!0},p=e.preprocess=function(t,o){void 0===o&&(o={});var n=t||l,s={};if(o.shadow,null!=n.shadowColor||null!=n.shadowOffset||null!=n.shadowOpacity||null!=n.shadowRadius){(0,r(d[3]).warnOnce)('shadowStyles',"\"shadow*\" style props are deprecated. Use \"boxShadow\".");var S=u(n);if(null!=S&&null==s.boxShadow){var p=n.boxShadow,x=p?p+", "+S:S;s.boxShadow=x}}if(o.textShadow,null!=n.textShadowColor||null!=n.textShadowOffset||null!=n.textShadowRadius){(0,r(d[3]).warnOnce)('textShadowStyles',"\"textShadow*\" style props are deprecated. Use \"textShadow\".");var b=h(n);if(null!=b&&null==s.textShadow){var v=n.textShadow,y=v?v+", "+b:b;s.textShadow=y}}for(var E in n)if(null==c[E]&&'shadowColor'!==E&&'shadowOffset'!==E&&'shadowOpacity'!==E&&'shadowRadius'!==E&&'textShadowColor'!==E&&'textShadowOffset'!==E&&'textShadowRadius'!==E){var O=n[E],R=f[E]||E,I=O;!Object.prototype.hasOwnProperty.call(n,E)||R!==E&&null!=n[R]||('aspectRatio'===R&&'number'==typeof I?s[R]=I.toString():'fontVariant'===R?(Array.isArray(I)&&I.length>0&&((0,r(d[3]).warnOnce)('fontVariant','"fontVariant" style array value is deprecated. Use space-separated values.'),I=I.join(' ')),s[R]=I):'textAlignVertical'===R?((0,r(d[3]).warnOnce)('textAlignVertical','"textAlignVertical" style is deprecated. Use "verticalAlign".'),null==n.verticalAlign&&(s.verticalAlign='center'===I?'middle':I)):'transform'===R?(Array.isArray(I)&&(I=w(I)),s.transform=I):s[R]=I)}return s};e.default=p}),32,[1,33,37,39]); -__d((function(_g,_r,i,_a,m,e,d){var t=_r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var u=t(_r(d[1])),f=t(_r(d[2]));e.default=function(t,r){if(void 0===r&&(r=1),null!=t){if('string'==typeof t&&(0,u.default)(t))return t;var l=(0,f.default)(t);if(null!=l)return"rgba("+(l>>16&255)+","+(l>>8&255)+","+(255&l)+","+((l>>24&255)/255*r).toFixed(2)+")"}}}),33,[1,34,35]); -__d((function(g,r,i,a,m,e,d){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;e.default=o=>'currentcolor'===o||'currentColor'===o||'inherit'===o||0===o.indexOf('var(')}),34,[]); -__d((function(g,r,i,a,m,e,d){var u=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var l=u(r(d[1]));e.default=u=>{if(null==u)return u;var t=(0,l.default)(u);return null!=t?t=(t<<24|t>>>8)>>>0:void 0}}),35,[1,36]); -__d((function(_g,_r,i,a,m,e,d){'use strict';function r(r,n,t){return t<0&&(t+=1),t>1&&(t-=1),t<.16666666666666666?r+6*(n-r)*t:t<.5?n:t<.6666666666666666?r+(n-r)*(.6666666666666666-t)*6:r}function n(n,t,s){const u=s<.5?s*(1+t):s+t-s*t,c=2*s-u,l=r(c,u,n+.3333333333333333),o=r(c,u,n),g=r(c,u,n-.3333333333333333);return Math.round(255*l)<<24|Math.round(255*o)<<16|Math.round(255*g)<<8}function t(n,t,s){if(t+s>=1){const r=Math.round(255*t/(t+s));return r<<24|r<<16|r<<8}const u=r(0,1,n+.3333333333333333)*(1-t-s)+t,c=r(0,1,n)*(1-t-s)+t,l=r(0,1,n-.3333333333333333)*(1-t-s)+t;return Math.round(255*u)<<24|Math.round(255*c)<<16|Math.round(255*l)<<8}const s='[-+]?\\d*\\.?\\d+',u="[-+]?\\d*\\.?\\d+%";function c(...r){return'\\(\\s*('+r.join(')\\s*,?\\s*(')+')\\s*\\)'}function l(...r){return'\\(\\s*('+r.slice(0,r.length-1).join(')\\s*,?\\s*(')+')\\s*/\\s*('+r[r.length-1]+')\\s*\\)'}function o(...r){return'\\(\\s*('+r.join(')\\s*,\\s*(')+')\\s*\\)'}let g;function h(){return void 0===g&&(g={rgb:new RegExp('rgb'+c(s,s,s)),rgba:new RegExp('rgba('+o(s,s,s,s)+'|'+l(s,s,s,s)+')'),hsl:new RegExp('hsl'+c(s,u,u)),hsla:new RegExp('hsla('+o(s,u,u,s)+'|'+l(s,u,u,s)+')'),hwb:new RegExp('hwb'+c(s,u,u)),hex3:/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex4:/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#([0-9a-fA-F]{6})$/,hex8:/^#([0-9a-fA-F]{8})$/}),g}function b(r){const n=parseInt(r,10);return n<0?0:n>255?255:n}function p(r){return(parseFloat(r)%360+360)%360/360}function f(r){const n=parseFloat(r);return n<0?0:n>1?255:Math.round(255*n)}function y(r){const n=parseFloat(r);return n<0?0:n>100?1:n/100}function k(r){switch(r){case'transparent':return 0;case'aliceblue':return 4042850303;case'antiquewhite':return 4209760255;case'aqua':case'cyan':return 16777215;case'aquamarine':return 2147472639;case'azure':return 4043309055;case'beige':return 4126530815;case'bisque':return 4293182719;case'black':return 255;case'blanchedalmond':return 4293643775;case'blue':return 65535;case'blueviolet':return 2318131967;case'brown':return 2771004159;case'burlywood':return 3736635391;case'burntsienna':return 3934150143;case'cadetblue':return 1604231423;case'chartreuse':return 2147418367;case'chocolate':return 3530104575;case'coral':return 4286533887;case'cornflowerblue':return 1687547391;case'cornsilk':return 4294499583;case'crimson':return 3692313855;case'darkblue':return 35839;case'darkcyan':return 9145343;case'darkgoldenrod':return 3095792639;case'darkgray':case'darkgrey':return 2846468607;case'darkgreen':return 6553855;case'darkkhaki':return 3182914559;case'darkmagenta':return 2332068863;case'darkolivegreen':return 1433087999;case'darkorange':return 4287365375;case'darkorchid':return 2570243327;case'darkred':return 2332033279;case'darksalmon':return 3918953215;case'darkseagreen':return 2411499519;case'darkslateblue':return 1211993087;case'darkslategray':case'darkslategrey':return 793726975;case'darkturquoise':return 13554175;case'darkviolet':return 2483082239;case'deeppink':return 4279538687;case'deepskyblue':return 12582911;case'dimgray':case'dimgrey':return 1768516095;case'dodgerblue':return 512819199;case'firebrick':return 2988581631;case'floralwhite':return 4294635775;case'forestgreen':return 579543807;case'fuchsia':case'magenta':return 4278255615;case'gainsboro':return 3705462015;case'ghostwhite':return 4177068031;case'gold':return 4292280575;case'goldenrod':return 3668254975;case'gray':case'grey':return 2155905279;case'green':return 8388863;case'greenyellow':return 2919182335;case'honeydew':return 4043305215;case'hotpink':return 4285117695;case'indianred':return 3445382399;case'indigo':return 1258324735;case'ivory':return 4294963455;case'khaki':return 4041641215;case'lavender':return 3873897215;case'lavenderblush':return 4293981695;case'lawngreen':return 2096890111;case'lemonchiffon':return 4294626815;case'lightblue':return 2916673279;case'lightcoral':return 4034953471;case'lightcyan':return 3774873599;case'lightgoldenrodyellow':return 4210742015;case'lightgray':case'lightgrey':return 3553874943;case'lightgreen':return 2431553791;case'lightpink':return 4290167295;case'lightsalmon':return 4288707327;case'lightseagreen':return 548580095;case'lightskyblue':return 2278488831;case'lightslategray':case'lightslategrey':return 2005441023;case'lightsteelblue':return 2965692159;case'lightyellow':return 4294959359;case'lime':return 16711935;case'limegreen':return 852308735;case'linen':return 4210091775;case'maroon':return 2147483903;case'mediumaquamarine':return 1724754687;case'mediumblue':return 52735;case'mediumorchid':return 3126187007;case'mediumpurple':return 2473647103;case'mediumseagreen':return 1018393087;case'mediumslateblue':return 2070474495;case'mediumspringgreen':return 16423679;case'mediumturquoise':return 1221709055;case'mediumvioletred':return 3340076543;case'midnightblue':return 421097727;case'mintcream':return 4127193855;case'mistyrose':return 4293190143;case'moccasin':return 4293178879;case'navajowhite':return 4292783615;case'navy':return 33023;case'oldlace':return 4260751103;case'olive':return 2155872511;case'olivedrab':return 1804477439;case'orange':return 4289003775;case'orangered':return 4282712319;case'orchid':return 3664828159;case'palegoldenrod':return 4008225535;case'palegreen':return 2566625535;case'paleturquoise':return 2951671551;case'palevioletred':return 3681588223;case'papayawhip':return 4293907967;case'peachpuff':return 4292524543;case'peru':return 3448061951;case'pink':return 4290825215;case'plum':return 3718307327;case'powderblue':return 2967529215;case'purple':return 2147516671;case'rebeccapurple':return 1714657791;case'red':return 4278190335;case'rosybrown':return 3163525119;case'royalblue':return 1097458175;case'saddlebrown':return 2336560127;case'salmon':return 4202722047;case'sandybrown':return 4104413439;case'seagreen':return 780883967;case'seashell':return 4294307583;case'sienna':return 2689740287;case'silver':return 3233857791;case'skyblue':return 2278484991;case'slateblue':return 1784335871;case'slategray':case'slategrey':return 1887473919;case'snow':return 4294638335;case'springgreen':return 16744447;case'steelblue':return 1182971135;case'tan':return 3535047935;case'teal':return 8421631;case'thistle':return 3636451583;case'tomato':return 4284696575;case'turquoise':return 1088475391;case'violet':return 4001558271;case'wheat':return 4125012991;case'white':return 4294967295;case'whitesmoke':return 4126537215;case'yellow':return 4294902015;case'yellowgreen':return 2597139199}return null}m.exports=function(r){if('number'==typeof r)return r>>>0===r&&r>=0&&r<=4294967295?r:null;if('string'!=typeof r)return null;const s=h();let u;if(u=s.hex6.exec(r))return parseInt(u[1]+'ff',16)>>>0;const c=k(r);return null!=c?c:(u=s.rgb.exec(r))?(b(u[1])<<24|b(u[2])<<16|b(u[3])<<8|255)>>>0:(u=s.rgba.exec(r))?void 0!==u[6]?(b(u[6])<<24|b(u[7])<<16|b(u[8])<<8|f(u[9]))>>>0:(b(u[2])<<24|b(u[3])<<16|b(u[4])<<8|f(u[5]))>>>0:(u=s.hex3.exec(r))?parseInt(u[1]+u[1]+u[2]+u[2]+u[3]+u[3]+'ff',16)>>>0:(u=s.hex8.exec(r))?parseInt(u[1],16)>>>0:(u=s.hex4.exec(r))?parseInt(u[1]+u[1]+u[2]+u[2]+u[3]+u[3]+u[4]+u[4],16)>>>0:(u=s.hsl.exec(r))?(255|n(p(u[1]),y(u[2]),y(u[3])))>>>0:(u=s.hsla.exec(r))?void 0!==u[6]?(n(p(u[6]),y(u[7]),y(u[8]))|f(u[9]))>>>0:(n(p(u[2]),y(u[3]),y(u[4]))|f(u[5]))>>>0:(u=s.hwb.exec(r))?(255|t(p(u[1]),y(u[2]),y(u[3])))>>>0:null}}),36,[]); -__d((function(g,r,i,a,m,e,d){var o=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(o,n){var C=o;null!=n&&l.default[n]||'number'!=typeof o?null!=n&&u[n]&&(C=(0,t.default)(o)):C=o+"px";return C};var l=o(r(d[1])),t=o(r(d[2])),u={backgroundColor:!0,borderColor:!0,borderTopColor:!0,borderRightColor:!0,borderBottomColor:!0,borderLeftColor:!0,color:!0,shadowColor:!0,textDecorationColor:!0,textShadowColor:!0}}),37,[1,38,33]); -__d((function(g,r,i,a,m,e,d){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var o={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,flex:!0,flexGrow:!0,flexOrder:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,fontWeight:!0,gridRow:!0,gridRowEnd:!0,gridRowGap:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnGap:!0,gridColumnStart:!0,lineClamp:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0,scale:!0,scaleX:!0,scaleY:!0,scaleZ:!0,shadowOpacity:!0},t=['ms','Moz','O','Webkit'],l=(o,t)=>o+t.charAt(0).toUpperCase()+t.substring(1);Object.keys(o).forEach((s=>{t.forEach((t=>{o[l(t,s)]=o[s]}))}));e.default=o}),38,[]); -__d((function(g,r,i,a,m,e,d){Object.defineProperty(e,"__esModule",{value:!0}),e.warnOnce=function(n,c){}}),39,[]); -__d((function(g,r,_i,a,m,e,d){var n=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.atomic=function(n){var t={$$css:!0},i=[];function o(n,t,o){var l,s=K(o,t),u=t+s,f=c.get(u);if(null!=f)l=f[0],i.push(f[1]);else{l=M('r',n,n!==t?u:s);var p=y[n]||v,b=[T(l,t,o),p];i.push(b),c.set(u,[l,b])}return l}return Object.keys(n).sort().forEach((i=>{var l=n[i];if(null!=l){var s;if(J.indexOf(i)>-1){var u=o(i,i,'left'),f=o(i,i,'right');'start'===l?s=[u,f]:'end'===l&&(s=[f,u])}var p=_[i];if(null!=p){var c=o(i,p,l),b=o(i,P[p],l);s=[c,b]}if('transitionProperty'===i){for(var h=Array.isArray(l)?l:[l],v=[],y=0;y0){var E=[...h],I=[...h];v.forEach((n=>{var t=E[n];if('string'==typeof t){var l=_[t],u=P[l];E[n]=l,I[n]=u;var f=o(i,i,E),p=o(i,i,I);s=[f,p]}}))}}null==s?s=o(i,i,l):t.$$css$localize=!0,t[i]=s}})),[t,i]},e.classic=function(n,o){var l,s={$$css:!0},u=[],f=n.animationKeyframes,c=(0,i.default)(n,p),b=M('css',o,JSON.stringify(n)),v="."+b;if(null!=f){var y=q(f),S=y[0],E=y[1];l=S.join(','),u.push(...E)}var I=z((0,t.default)((0,t.default)({},c),{},{animationName:l}));return u.push(""+v+I),s[b]=b,[s,[[u,h]]]},e.inline=function(n,t){var i=n||b,l={},s={},u=function(){var n=i[f],o=f,u=n;if(!Object.prototype.hasOwnProperty.call(i,f)||null==n)return"continue";J.indexOf(f)>-1&&('start'===n?u=t?'right':'left':'end'===n&&(u=t?'left':'right'));var p=_[f];if(null!=p&&(o=t?P[p]:p),'transitionProperty'===f){var c=Array.isArray(n)?n:[n];c.forEach(((n,i)=>{if('string'==typeof n){var o=_[n];null!=o&&(c[i]=t?P[o]:o,u=c.join(' '))}}))}l[o]||(s[o]=u),o===f&&(l[o]=!0)};for(var f in i)u();return(0,o.default)(s,!0)},e.stringifyValueWithProperty=K;var t=n(r(d[1])),i=n(r(d[2])),o=n(r(d[3])),l=n(r(d[4])),s=n(r(d[5])),u=n(r(d[6])),f=n(r(d[7])),p=["animationKeyframes"],c=new Map,b={},h=1,v=3,y={borderColor:2,borderRadius:2,borderStyle:2,borderWidth:2,display:2,flex:2,inset:2,margin:2,overflow:2,overscrollBehavior:2,padding:2,insetBlock:2.1,insetInline:2.1,marginInline:2.1,marginBlock:2.1,paddingInline:2.1,paddingBlock:2.1,borderBlockStartColor:2.2,borderBlockStartStyle:2.2,borderBlockStartWidth:2.2,borderBlockEndColor:2.2,borderBlockEndStyle:2.2,borderBlockEndWidth:2.2,borderInlineStartColor:2.2,borderInlineStartStyle:2.2,borderInlineStartWidth:2.2,borderInlineEndColor:2.2,borderInlineEndStyle:2.2,borderInlineEndWidth:2.2,borderEndStartRadius:2.2,borderEndEndRadius:2.2,borderStartStartRadius:2.2,borderStartEndRadius:2.2,insetBlockEnd:2.2,insetBlockStart:2.2,insetInlineEnd:2.2,insetInlineStart:2.2,marginBlockStart:2.2,marginBlockEnd:2.2,marginInlineStart:2.2,marginInlineEnd:2.2,paddingBlockStart:2.2,paddingBlockEnd:2.2,paddingInlineStart:2.2,paddingInlineEnd:2.2},S='borderTopLeftRadius',E='borderTopRightRadius',I='borderBottomLeftRadius',k='borderBottomRightRadius',R='borderLeftColor',B='borderLeftStyle',W='borderLeftWidth',j='borderRightColor',C='borderRightStyle',O='borderRightWidth',w='right',x='marginLeft',A='marginRight',L='paddingLeft',$='paddingRight',N='left',P={[S]:E,[E]:S,[I]:k,[k]:I,[R]:j,[B]:C,[W]:O,[j]:R,[C]:B,[O]:W,[N]:w,[x]:A,[A]:x,[L]:$,[$]:L,[w]:N},_={borderStartStartRadius:S,borderStartEndRadius:E,borderEndStartRadius:I,borderEndEndRadius:k,borderInlineStartColor:R,borderInlineStartStyle:B,borderInlineStartWidth:W,borderInlineEndColor:j,borderInlineEndStyle:C,borderInlineEndWidth:O,insetInlineEnd:w,insetInlineStart:N,marginInlineStart:x,marginInlineEnd:A,paddingInlineStart:L,paddingInlineEnd:$},J=['clear','float','textAlign'];function K(n,t){var i=(0,u.default)(n,t);return'string'!=typeof i?JSON.stringify(i||''):i}function T(n,t,i){var o=[],l="."+n;switch(t){case'animationKeyframes':var s=q(i),u=s[0],f=s[1],p=z({animationName:u.join(',')});o.push(""+l+p,...f);break;case'placeholderTextColor':var c=z({color:i,opacity:1});o.push(l+"::-webkit-input-placeholder"+c,l+"::-moz-placeholder"+c,l+":-ms-input-placeholder"+c,l+"::placeholder"+c);break;case'pointerEvents':var b=i;if('auto'===i||'box-only'===i){if(b='auto!important','box-only'===i){var h=z({pointerEvents:'none'});o.push(l+">*"+h)}}else if(('none'===i||'box-none'===i)&&(b='none!important','box-none'===i)){var v=z({pointerEvents:'auto'});o.push(l+">*"+v)}var y=z({pointerEvents:b});o.push(""+l+y);break;case'scrollbarWidth':'none'===i&&o.push(l+"::-webkit-scrollbar{display:none}");var S=z({scrollbarWidth:i});o.push(""+l+S);break;default:var E=z({[t]:i});o.push(""+l+E)}return o}function z(n){var t=(0,f.default)((0,o.default)(n));return"{"+Object.keys(t).map((n=>{var i=t[n],o=(0,s.default)(n);return Array.isArray(i)?i.map((n=>o+":"+n)).join(';'):o+":"+i})).sort().join(';')+";}"}function M(n,t,i){return n+"-"+(0,l.default)(t+i)}function V(n){var t=M('r','animation',JSON.stringify(n)),i='{'+Object.keys(n).map((t=>""+t+z(n[t]))).join('')+'}',o=['-webkit-',''].map((n=>"@"+n+"keyframes "+t+i));return[t,o]}function q(n){if('number'==typeof n)throw new Error("Invalid CSS keyframes type: "+typeof n);var t=[],i=[];return(Array.isArray(n)?n:[n]).forEach((n=>{if('string'==typeof n)t.push(n);else{var o=V(n),l=o[0],s=o[1];t.push(l),i.push(...s)}})),[t,i]}}),40,[1,5,28,41,42,43,37,44]); -__d((function(g,r,_i,a,m,e,d){var o=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=o(r(d[1])),i=o(r(d[2])),n={},l=!i.default||null!=window.CSS&&null!=window.CSS.supports&&(window.CSS.supports('text-decoration-line','none')||window.CSS.supports('-webkit-text-decoration-line','none')),b='-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif',p={borderColor:['borderTopColor','borderRightColor','borderBottomColor','borderLeftColor'],borderBlockColor:['borderTopColor','borderBottomColor'],borderInlineColor:['borderRightColor','borderLeftColor'],borderRadius:['borderTopLeftRadius','borderTopRightRadius','borderBottomRightRadius','borderBottomLeftRadius'],borderStyle:['borderTopStyle','borderRightStyle','borderBottomStyle','borderLeftStyle'],borderBlockStyle:['borderTopStyle','borderBottomStyle'],borderInlineStyle:['borderRightStyle','borderLeftStyle'],borderWidth:['borderTopWidth','borderRightWidth','borderBottomWidth','borderLeftWidth'],borderBlockWidth:['borderTopWidth','borderBottomWidth'],borderInlineWidth:['borderRightWidth','borderLeftWidth'],insetBlock:['top','bottom'],insetInline:['left','right'],marginBlock:['marginTop','marginBottom'],marginInline:['marginRight','marginLeft'],paddingBlock:['paddingTop','paddingBottom'],paddingInline:['paddingRight','paddingLeft'],overflow:['overflowX','overflowY'],overscrollBehavior:['overscrollBehaviorX','overscrollBehaviorY'],borderBlockStartColor:['borderTopColor'],borderBlockStartStyle:['borderTopStyle'],borderBlockStartWidth:['borderTopWidth'],borderBlockEndColor:['borderBottomColor'],borderBlockEndStyle:['borderBottomStyle'],borderBlockEndWidth:['borderBottomWidth'],borderEndStartRadius:['borderBottomLeftRadius'],borderEndEndRadius:['borderBottomRightRadius'],borderStartStartRadius:['borderTopLeftRadius'],borderStartEndRadius:['borderTopRightRadius'],insetBlockEnd:['bottom'],insetBlockStart:['top'],marginBlockStart:['marginTop'],marginBlockEnd:['marginBottom'],paddingBlockStart:['paddingTop'],paddingBlockEnd:['paddingBottom']};e.default=(o,i)=>{if(!o)return n;var s={},f=function(){var n=o[B];if(null==n)return"continue";if('backgroundClip'===B)'text'===n&&(s.backgroundClip=n,s.WebkitBackgroundClip=n);else if('flex'===B)-1===n?(s.flexGrow=0,s.flexShrink=1,s.flexBasis='auto'):s.flex=n;else if('font'===B)s[B]=n.replace('System',b);else if('fontFamily'===B)if(n.indexOf('System')>-1){var f=n.split(/,\s*/);f[f.indexOf('System')]=b,s[B]=f.join(',')}else s[B]='monospace'===n?"monospace,monospace":n;else if('textDecorationLine'===B)l?s.textDecorationLine=n:s.textDecoration=n;else if('writingDirection'===B)s.direction=n;else{var c=(0,t.default)(o[B],B),u=p[B];i&&'inset'===B?(null==o.insetInline&&(s.left=c,s.right=c),null==o.insetBlock&&(s.top=c,s.bottom=c)):i&&'margin'===B?(null==o.marginInline&&(s.marginLeft=c,s.marginRight=c),null==o.marginBlock&&(s.marginTop=c,s.marginBottom=c)):i&&'padding'===B?(null==o.paddingInline&&(s.paddingLeft=c,s.paddingRight=c),null==o.paddingBlock&&(s.paddingTop=c,s.paddingBottom=c)):u?u.forEach(((t,i)=>{null==o[t]&&(s[t]=c)})):s[B]=c}};for(var B in o)f();return s}}),41,[1,37,23]); -__d((function(g,r,_i,a,m,e,d){function t(t,c){for(var o,h=t.length,n=c^h,u=0;h>=4;)o=1540483477*(65535&(o=255&t.charCodeAt(u)|(255&t.charCodeAt(++u))<<8|(255&t.charCodeAt(++u))<<16|(255&t.charCodeAt(++u))<<24))+((1540483477*(o>>>16)&65535)<<16),n=1540483477*(65535&n)+((1540483477*(n>>>16)&65535)<<16)^(o=1540483477*(65535&(o^=o>>>24))+((1540483477*(o>>>16)&65535)<<16)),h-=4,++u;switch(h){case 3:n^=(255&t.charCodeAt(u+2))<<16;case 2:n^=(255&t.charCodeAt(u+1))<<8;case 1:n=1540483477*(65535&(n^=255&t.charCodeAt(u)))+((1540483477*(n>>>16)&65535)<<16)}return n=1540483477*(65535&(n^=n>>>13))+((1540483477*(n>>>16)&65535)<<16),(n^=n>>>15)>>>0}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;e.default=c=>t(c,1).toString(36)}),42,[]); -__d((function(g,r,i,a,m,e,d){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=/[A-Z]/g,n=/^ms-/,u={};function o(t){return'-'+t.toLowerCase()}e.default=function(f){if(f in u)return u[f];var c=f.replace(t,o);return u[f]=n.test(c)?'-'+c:c}}),43,[]); -__d((function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var u=t(r(d[1])),f=t(r(d[2])),l=(0,u.default)(f.default);e.default=l}),44,[1,45,51]); -__d((function(g,r,_i,a,m,e,d){'use strict';Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(l){var i=l.prefixMap,o=l.plugins;return function l(s){for(var v in s){var c=s[v];if((0,n.default)(c))s[v]=l(c);else if(Array.isArray(c)){for(var _=[],p=0,y=c.length;p0&&(s[v]=_)}else{var h=(0,u.default)(o,v,c,s,i);h&&(s[v]=h),s=(0,t.default)(i,v,s)}}return s}};var t=l(r(d[0])),u=l(r(d[1])),f=l(r(d[2])),n=l(r(d[3]));function l(t){return t&&t.__esModule?t:{default:t}}}),45,[46,48,49,50]); -__d((function(g,r,_i,a,m,e,d){'use strict';Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,f,n){var l=t[f];if(l&&n.hasOwnProperty(f))for(var o=(0,u.default)(f),_=0;_t.length)&&(n=t.length);for(var o=0,i=new Array(n);o-1)return n.map((function(t){return f.replace(/image-set\(/g,t+'image-set(')}))};var t,u=(t=r(d[0]))&&t.__esModule?t:{default:t};var n=['-webkit-','']}),70,[71]); -__d((function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(n){return'string'==typeof n&&t.test(n)};var t=/-webkit-|-moz-|-ms-/}),71,[]); -__d((function(g,r,_i,a,m,e,d){'use strict';Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(o,n,i){if(Object.prototype.hasOwnProperty.call(t,o))for(var l=t[o],b=0,B=l.length;b-1)return p;var v=l.split(/,(?![^()]*(?:\([^()]*\))?\))/g).filter((function(t){return!/-webkit-|-ms-/.test(t)})).join(',');return t.indexOf('Moz')>-1?v:(o['Webkit'+(0,n.default)(t)]=p,o['Moz'+(0,n.default)(t)]=v,l)}};var t=o(r(d[0])),i=o(r(d[1])),n=o(r(d[2]));function o(t){return t&&t.__esModule?t:{default:t}}var f={transition:!0,transitionProperty:!0,WebkitTransition:!0,WebkitTransitionProperty:!0,MozTransition:!0,MozTransitionProperty:!0},u={Webkit:'-webkit-',Moz:'-moz-',ms:'-ms-'};function s(n,o){if((0,i.default)(n))return n;for(var f=n.split(/,(?![^()]*(?:\([^()]*\))?\))/g),s=0,l=f.length;s-1&&'order'!==b)for(var k=o[c],z=0,M=k.length;z'web'in t?t.web:t.default,get isTesting(){return!1}};e.default=t}),77,[]); -__d((function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var u=t(r(d[1]));e.default=u.default}),78,[1,79]); -__d((function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=t(r(d[1])),s=t(r(d[2])),o=t(r(d[3])),c=t(r(d[4])),l=t(r(d[5])),u=t(r(d[6])),f=t(r(d[7])),p=t(r(d[8])),h=t(r(d[9])),x=t(r(d[10])),P=r(d[11]);u.default.ignoreLogs(['Warning: isMounted(...) is deprecated','Module RCTImageLoader']);const S=o.default.create({noPermissionsText:{fontSize:18,fontWeight:'bold'}});s.default.setAccessToken(x.default.get('accessToken'));const j=(0,r(d[12]).createNativeStackNavigator)();function A(){return(0,P.jsxs)(j.Navigator,{initialRouteName:"Group",screenOptions:{gestureEnabled:!1,headerShown:!1},children:[(0,P.jsx)(j.Screen,{name:"Group",component:r(d[13]).Group}),(0,P.jsx)(j.Screen,{name:"Item",component:r(d[13]).Item}),(0,P.jsx)(j.Screen,{name:"ScreenWithoutMap",component:r(d[14]).ScreenWithoutMap})]})}const v=()=>(0,P.jsx)(r(d[15]).SafeAreaProvider,{children:(0,P.jsx)(r(d[16]).NavigationContainer,{children:(0,P.jsx)(A,{})})});class I extends n.default.Component{constructor(t){super(t),this.state={isFetchingAndroidPermission:r(d[17]).IS_ANDROID,isAndroidPermissionGranted:!1,activeExample:-1}}async componentDidMount(){if(r(d[17]).IS_ANDROID){const t=await s.default.requestAndroidLocationPermissions();this.setState({isAndroidPermissionGranted:t,isFetchingAndroidPermission:!1})}}render(){return r(d[17]).IS_ANDROID&&!this.state.isAndroidPermissionGranted?this.state.isFetchingAndroidPermission?null:(0,P.jsx)(f.default,{style:[p.default.matchParent,{backgroundColor:h.default.primary.blue}],forceInset:{top:'always'},children:(0,P.jsx)(l.default,{style:p.default.matchParent,children:(0,P.jsx)(c.default,{style:S.noPermissionsText,children:"You need to accept location permissions in order to use this example applications"})})}):(0,P.jsx)(v,{})}}e.default=I}),79,[1,14,80,27,92,122,123,124,125,126,127,87,129,352,809,325,139,678]); -__d((function(g,_r,_i,_a,m,_e,d){Object.defineProperty(_e,"__esModule",{value:!0});var e={};Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return t.default}});var t=(function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=r(t);if(n&&n.has(e))return n.get(e);var u={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var f in e)if("default"!==f&&{}.hasOwnProperty.call(e,f)){var a=o?Object.getOwnPropertyDescriptor(e,f):null;a&&(a.get||a.set)?Object.defineProperty(u,f,a):u[f]=e[f]}return u.default=e,n&&n.set(e,u),u})(_r(d[0]));function r(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(r=function(e){return e?n:t})(e)}Object.keys(t).forEach((function(r){"default"!==r&&"__esModule"!==r&&(Object.prototype.hasOwnProperty.call(e,r)||r in _e&&_e[r]===t[r]||Object.defineProperty(_e,r,{enumerable:!0,get:function(){return t[r]}}))}))}),80,[81]); -__d((function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"Camera",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(e,"Logger",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(e,"MapView",{enumerable:!0,get:function(){return f.default}}),Object.defineProperty(e,"MarkerView",{enumerable:!0,get:function(){return l.default}}),e.default=void 0,r(d[1]);var u=t(r(d[2])),n=t(r(d[3])),f=t(r(d[4])),l=t(r(d[5])),o=t(r(d[6]));const c={Camera:n.default,MapView:f.default,Logger:o.default,MarkerView:l.default},b=Object.assign({},u.default,c);e.default=b}),81,[1,82,83,85,89,90,91]); -__d((function(g,r,i,a,m,e,d){}),82,[]); -__d((function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var s=t(r(d[1]));const l={LineJoin:{},StyleURL:{Street:'mapbox://styles/mapbox/streets-v11',Satellite:'mapbox://styles/mapbox/satellite-v9'},setAccessToken:t=>{s.default.accessToken=t}};e.default=l}),83,[1,84]); -__d((function(e,t,i,r,n,o,s){var a=t(s[0]);const l=["data"],c=["data"];!(function(e,t){'object'==typeof o&&void 0!==n?n.exports=t():'function'==typeof define&&define.amd?define(t):(e='undefined'!=typeof globalThis?globalThis:e||self).mapboxgl=t()})(this,(function(){'use strict';var e,t,i;function r(r,n){if(e)if(t){var o="self.onerror = function() { console.error('An error occurred while parsing the WebWorker bundle. This is most likely due to improper transpilation by Babel; please see https://docs.mapbox.com/mapbox-gl-js/guides/install/#transpiling'); }; var sharedChunk = {}; ("+e+")(sharedChunk); ("+t+")(sharedChunk); self.onerror = null;",s={};e(s),i=n(s),window&&window.URL&&window.URL.createObjectURL&&(i.workerUrl=window.URL.createObjectURL(new Blob([o],{type:'text/javascript'})))}else t=n;else e=n}return r(0,(function(e){var t="3.6.0";let i;const r={API_URL:"https://api.mapbox.com",get API_URL_REGEX(){if(null==i){const e=/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i;try{i=null!=process.env.API_URL_REGEX?new RegExp(process.env.API_URL_REGEX):e}catch(t){i=e}}return i},get API_TILEJSON_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/v[0-9]*\/.*\.json.*$)/i},get API_SPRITE_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/styles\/v[0-9]*\/)(.*\/sprite.*\..*$)/i},get API_FONTS_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/fonts\/v[0-9]*\/)(.*\.pbf.*$)/i},get API_STYLE_REGEX(){return/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/styles\/v[0-9]*\/)(.*$)/i},get API_CDN_URL_REGEX(){return/^((https?:)?\/\/)?api\.mapbox\.c(n|om)(\/mapbox-gl-js\/)(.*$)/i},get EVENTS_URL(){if(!r.API_URL)return null;try{const e=new URL(r.API_URL);return"api.mapbox.cn"===e.hostname?"https://events.mapbox.cn/events/v2":"api.mapbox.com"===e.hostname?"https://events.mapbox.com/events/v2":null}catch(e){return null}},SESSION_PATH:"/map-sessions/v1",FEEDBACK_URL:"https://apps.mapbox.com/feedback",TILE_URL_VERSION:"v4",RASTER_URL_PREFIX:"raster/v1",RASTERARRAYS_URL_PREFIX:"rasterarrays/v1",REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null,DEFAULT_STYLE:"mapbox://styles/mapbox/standard",MAX_PARALLEL_IMAGE_REQUESTS:16,DRACO_URL:"https://api.mapbox.com/mapbox-gl-js/draco_decoder_gltf_v1.5.6.wasm",MESHOPT_URL:"https://api.mapbox.com/mapbox-gl-js/meshopt_base_v0.20.wasm",MESHOPT_SIMD_URL:"https://api.mapbox.com/mapbox-gl-js/meshopt_simd_v0.20.wasm",GLYPHS_URL:"mapbox://fonts/mapbox/{fontstack}/{range}.pbf",TILES3D_URL_PREFIX:"3dtiles/v1"};function n(e){return r.API_URL_REGEX.test(e)}function o(e){return 0===e.indexOf("mapbox:")}function s(e){return r.API_CDN_URL_REGEX.test(e)}function a(e){return r.API_SPRITE_REGEX.test(e)}function l(e){return r.API_STYLE_REGEX.test(e)&&!a(e)}const c={create:"create",load:"load",fullLoad:"fullLoad"},h={mark(e){performance.mark(e)},measure(e,t,i){performance.measure(e,t,i)}};function u(e){const t=e.name.split("?")[0];return s(t)&&t.includes("mapbox-gl.js")?"javascript":s(t)&&t.includes("mapbox-gl.css")?"css":(function(e){return r.API_FONTS_REGEX.test(e)})(t)?"fontRange":a(t)?"sprite":l(t)?"style":(function(e){return r.API_TILEJSON_REGEX.test(e)})(t)?"tilejson":"other"}function d(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var p={},f={};Object.defineProperty(f,"__esModule",{value:!0}),f.setMatrixArrayType=function(e){f.ARRAY_TYPE=_=e},f.toRadian=function(e){return e*y},f.equals=function(e,t){return Math.abs(e-t)<=m*Math.max(1,Math.abs(e),Math.abs(t))},f.RANDOM=f.ARRAY_TYPE=f.EPSILON=void 0;var m=1e-6;f.EPSILON=m;var _="undefined"!=typeof Float32Array?Float32Array:Array;f.ARRAY_TYPE=_;var g=Math.random;f.RANDOM=g;var y=Math.PI/180;Math.hypot||(Math.hypot=function(){for(var e=0,t=arguments.length;t--;)e+=arguments[t]*arguments[t];return Math.sqrt(e)});var x={};function v(e){return v="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},v(e)}Object.defineProperty(x,"__esModule",{value:!0}),x.create=function(){var e=new b.ARRAY_TYPE(4);return b.ARRAY_TYPE!=Float32Array&&(e[1]=0,e[2]=0),e[0]=1,e[3]=1,e},x.clone=function(e){var t=new b.ARRAY_TYPE(4);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},x.copy=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e},x.identity=function(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e},x.fromValues=function(e,t,i,r){var n=new b.ARRAY_TYPE(4);return n[0]=e,n[1]=t,n[2]=i,n[3]=r,n},x.set=function(e,t,i,r,n){return e[0]=t,e[1]=i,e[2]=r,e[3]=n,e},x.transpose=function(e,t){if(e===t){var i=t[1];e[1]=t[2],e[2]=i}else e[0]=t[0],e[1]=t[2],e[2]=t[1],e[3]=t[3];return e},x.invert=function(e,t){var i=t[0],r=t[1],n=t[2],o=t[3],s=i*o-n*r;return s?(e[0]=o*(s=1/s),e[1]=-r*s,e[2]=-n*s,e[3]=i*s,e):null},x.adjoint=function(e,t){var i=t[0];return e[0]=t[3],e[1]=-t[1],e[2]=-t[2],e[3]=i,e},x.determinant=function(e){return e[0]*e[3]-e[2]*e[1]},x.multiply=T,x.rotate=function(e,t,i){var r=t[0],n=t[1],o=t[2],s=t[3],a=Math.sin(i),l=Math.cos(i);return e[0]=r*l+o*a,e[1]=n*l+s*a,e[2]=r*-a+o*l,e[3]=n*-a+s*l,e},x.scale=function(e,t,i){var r=t[1],n=t[2],o=t[3],s=i[0],a=i[1];return e[0]=t[0]*s,e[1]=r*s,e[2]=n*a,e[3]=o*a,e},x.fromRotation=function(e,t){var i=Math.sin(t),r=Math.cos(t);return e[0]=r,e[1]=i,e[2]=-i,e[3]=r,e},x.fromScaling=function(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=t[1],e},x.str=function(e){return"mat2("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+")"},x.frob=function(e){return Math.hypot(e[0],e[1],e[2],e[3])},x.LDU=function(e,t,i,r){return e[2]=r[2]/r[0],i[0]=r[0],i[1]=r[1],i[3]=r[3]-e[2]*i[1],[e,t,i]},x.add=function(e,t,i){return e[0]=t[0]+i[0],e[1]=t[1]+i[1],e[2]=t[2]+i[2],e[3]=t[3]+i[3],e},x.subtract=E,x.exactEquals=function(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]},x.equals=function(e,t){var i=e[0],r=e[1],n=e[2],o=e[3],s=t[0],a=t[1],l=t[2],c=t[3];return Math.abs(i-s)<=b.EPSILON*Math.max(1,Math.abs(i),Math.abs(s))&&Math.abs(r-a)<=b.EPSILON*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(n-l)<=b.EPSILON*Math.max(1,Math.abs(n),Math.abs(l))&&Math.abs(o-c)<=b.EPSILON*Math.max(1,Math.abs(o),Math.abs(c))},x.multiplyScalar=function(e,t,i){return e[0]=t[0]*i,e[1]=t[1]*i,e[2]=t[2]*i,e[3]=t[3]*i,e},x.multiplyScalarAndAdd=function(e,t,i,r){return e[0]=t[0]+i[0]*r,e[1]=t[1]+i[1]*r,e[2]=t[2]+i[2]*r,e[3]=t[3]+i[3]*r,e},x.sub=x.mul=void 0;var b=(function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==v(e)&&"function"!=typeof e)return{default:e};var t=w(void 0);if(t&&t.has(e))return t.get(e);var i={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if("default"!==n&&Object.prototype.hasOwnProperty.call(e,n)){var o=r?Object.getOwnPropertyDescriptor(e,n):null;o&&(o.get||o.set)?Object.defineProperty(i,n,o):i[n]=e[n]}return i.default=e,t&&t.set(e,i),i})(f);function w(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,i=new WeakMap;return(w=function(e){return e?i:t})(e)}function T(e,t,i){var r=t[0],n=t[1],o=t[2],s=t[3],a=i[0],l=i[1],c=i[2],h=i[3];return e[0]=r*a+o*l,e[1]=n*a+s*l,e[2]=r*c+o*h,e[3]=n*c+s*h,e}function E(e,t,i){return e[0]=t[0]-i[0],e[1]=t[1]-i[1],e[2]=t[2]-i[2],e[3]=t[3]-i[3],e}x.mul=T,x.sub=E;var S={};function M(e){return M="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},M(e)}Object.defineProperty(S,"__esModule",{value:!0}),S.create=function(){var e=new A.ARRAY_TYPE(6);return A.ARRAY_TYPE!=Float32Array&&(e[1]=0,e[2]=0,e[4]=0,e[5]=0),e[0]=1,e[3]=1,e},S.clone=function(e){var t=new A.ARRAY_TYPE(6);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t},S.copy=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e},S.identity=function(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e},S.fromValues=function(e,t,i,r,n,o){var s=new A.ARRAY_TYPE(6);return s[0]=e,s[1]=t,s[2]=i,s[3]=r,s[4]=n,s[5]=o,s},S.set=function(e,t,i,r,n,o,s){return e[0]=t,e[1]=i,e[2]=r,e[3]=n,e[4]=o,e[5]=s,e},S.invert=function(e,t){var i=t[0],r=t[1],n=t[2],o=t[3],s=t[4],a=t[5],l=i*o-r*n;return l?(e[0]=o*(l=1/l),e[1]=-r*l,e[2]=-n*l,e[3]=i*l,e[4]=(n*a-o*s)*l,e[5]=(r*s-i*a)*l,e):null},S.determinant=function(e){return e[0]*e[3]-e[1]*e[2]},S.multiply=C,S.rotate=function(e,t,i){var r=t[0],n=t[1],o=t[2],s=t[3],a=t[4],l=t[5],c=Math.sin(i),h=Math.cos(i);return e[0]=r*h+o*c,e[1]=n*h+s*c,e[2]=r*-c+o*h,e[3]=n*-c+s*h,e[4]=a,e[5]=l,e},S.scale=function(e,t,i){var r=t[1],n=t[2],o=t[3],s=t[4],a=t[5],l=i[0],c=i[1];return e[0]=t[0]*l,e[1]=r*l,e[2]=n*c,e[3]=o*c,e[4]=s,e[5]=a,e},S.translate=function(e,t,i){var r=t[0],n=t[1],o=t[2],s=t[3],a=t[4],l=t[5],c=i[0],h=i[1];return e[0]=r,e[1]=n,e[2]=o,e[3]=s,e[4]=r*c+o*h+a,e[5]=n*c+s*h+l,e},S.fromRotation=function(e,t){var i=Math.sin(t),r=Math.cos(t);return e[0]=r,e[1]=i,e[2]=-i,e[3]=r,e[4]=0,e[5]=0,e},S.fromScaling=function(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=t[1],e[4]=0,e[5]=0,e},S.fromTranslation=function(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=t[0],e[5]=t[1],e},S.str=function(e){return"mat2d("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+")"},S.frob=function(e){return Math.hypot(e[0],e[1],e[2],e[3],e[4],e[5],1)},S.add=function(e,t,i){return e[0]=t[0]+i[0],e[1]=t[1]+i[1],e[2]=t[2]+i[2],e[3]=t[3]+i[3],e[4]=t[4]+i[4],e[5]=t[5]+i[5],e},S.subtract=P,S.multiplyScalar=function(e,t,i){return e[0]=t[0]*i,e[1]=t[1]*i,e[2]=t[2]*i,e[3]=t[3]*i,e[4]=t[4]*i,e[5]=t[5]*i,e},S.multiplyScalarAndAdd=function(e,t,i,r){return e[0]=t[0]+i[0]*r,e[1]=t[1]+i[1]*r,e[2]=t[2]+i[2]*r,e[3]=t[3]+i[3]*r,e[4]=t[4]+i[4]*r,e[5]=t[5]+i[5]*r,e},S.exactEquals=function(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]},S.equals=function(e,t){var i=e[0],r=e[1],n=e[2],o=e[3],s=e[4],a=e[5],l=t[0],c=t[1],h=t[2],u=t[3],d=t[4],p=t[5];return Math.abs(i-l)<=A.EPSILON*Math.max(1,Math.abs(i),Math.abs(l))&&Math.abs(r-c)<=A.EPSILON*Math.max(1,Math.abs(r),Math.abs(c))&&Math.abs(n-h)<=A.EPSILON*Math.max(1,Math.abs(n),Math.abs(h))&&Math.abs(o-u)<=A.EPSILON*Math.max(1,Math.abs(o),Math.abs(u))&&Math.abs(s-d)<=A.EPSILON*Math.max(1,Math.abs(s),Math.abs(d))&&Math.abs(a-p)<=A.EPSILON*Math.max(1,Math.abs(a),Math.abs(p))},S.sub=S.mul=void 0;var A=(function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==M(e)&&"function"!=typeof e)return{default:e};var t=I(void 0);if(t&&t.has(e))return t.get(e);var i={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if("default"!==n&&Object.prototype.hasOwnProperty.call(e,n)){var o=r?Object.getOwnPropertyDescriptor(e,n):null;o&&(o.get||o.set)?Object.defineProperty(i,n,o):i[n]=e[n]}return i.default=e,t&&t.set(e,i),i})(f);function I(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,i=new WeakMap;return(I=function(e){return e?i:t})(e)}function C(e,t,i){var r=t[0],n=t[1],o=t[2],s=t[3],a=t[4],l=t[5],c=i[0],h=i[1],u=i[2],d=i[3],p=i[4],f=i[5];return e[0]=r*c+o*h,e[1]=n*c+s*h,e[2]=r*u+o*d,e[3]=n*u+s*d,e[4]=r*p+o*f+a,e[5]=n*p+s*f+l,e}function P(e,t,i){return e[0]=t[0]-i[0],e[1]=t[1]-i[1],e[2]=t[2]-i[2],e[3]=t[3]-i[3],e[4]=t[4]-i[4],e[5]=t[5]-i[5],e}S.mul=C,S.sub=P;var z={};function D(e){return D="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},D(e)}Object.defineProperty(z,"__esModule",{value:!0}),z.create=function(){var e=new R.ARRAY_TYPE(9);return R.ARRAY_TYPE!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[5]=0,e[6]=0,e[7]=0),e[0]=1,e[4]=1,e[8]=1,e},z.fromMat4=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e},z.clone=function(e){var t=new R.ARRAY_TYPE(9);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t},z.copy=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e},z.fromValues=function(e,t,i,r,n,o,s,a,l){var c=new R.ARRAY_TYPE(9);return c[0]=e,c[1]=t,c[2]=i,c[3]=r,c[4]=n,c[5]=o,c[6]=s,c[7]=a,c[8]=l,c},z.set=function(e,t,i,r,n,o,s,a,l,c){return e[0]=t,e[1]=i,e[2]=r,e[3]=n,e[4]=o,e[5]=s,e[6]=a,e[7]=l,e[8]=c,e},z.identity=function(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e},z.transpose=function(e,t){if(e===t){var i=t[1],r=t[2],n=t[5];e[1]=t[3],e[2]=t[6],e[3]=i,e[5]=t[7],e[6]=r,e[7]=n}else e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8];return e},z.invert=function(e,t){var i=t[0],r=t[1],n=t[2],o=t[3],s=t[4],a=t[5],l=t[6],c=t[7],h=t[8],u=h*s-a*c,d=-h*o+a*l,p=c*o-s*l,f=i*u+r*d+n*p;return f?(e[0]=u*(f=1/f),e[1]=(-h*r+n*c)*f,e[2]=(a*r-n*s)*f,e[3]=d*f,e[4]=(h*i-n*l)*f,e[5]=(-a*i+n*o)*f,e[6]=p*f,e[7]=(-c*i+r*l)*f,e[8]=(s*i-r*o)*f,e):null},z.adjoint=function(e,t){var i=t[0],r=t[1],n=t[2],o=t[3],s=t[4],a=t[5],l=t[6],c=t[7],h=t[8];return e[0]=s*h-a*c,e[1]=n*c-r*h,e[2]=r*a-n*s,e[3]=a*l-o*h,e[4]=i*h-n*l,e[5]=n*o-i*a,e[6]=o*c-s*l,e[7]=r*l-i*c,e[8]=i*s-r*o,e},z.determinant=function(e){var t=e[3],i=e[4],r=e[5],n=e[6],o=e[7],s=e[8];return e[0]*(s*i-r*o)+e[1]*(-s*t+r*n)+e[2]*(o*t-i*n)},z.multiply=k,z.translate=function(e,t,i){var r=t[0],n=t[1],o=t[2],s=t[3],a=t[4],l=t[5],c=t[6],h=t[7],u=t[8],d=i[0],p=i[1];return e[0]=r,e[1]=n,e[2]=o,e[3]=s,e[4]=a,e[5]=l,e[6]=d*r+p*s+c,e[7]=d*n+p*a+h,e[8]=d*o+p*l+u,e},z.rotate=function(e,t,i){var r=t[0],n=t[1],o=t[2],s=t[3],a=t[4],l=t[5],c=t[6],h=t[7],u=t[8],d=Math.sin(i),p=Math.cos(i);return e[0]=p*r+d*s,e[1]=p*n+d*a,e[2]=p*o+d*l,e[3]=p*s-d*r,e[4]=p*a-d*n,e[5]=p*l-d*o,e[6]=c,e[7]=h,e[8]=u,e},z.scale=function(e,t,i){var r=i[0],n=i[1];return e[0]=r*t[0],e[1]=r*t[1],e[2]=r*t[2],e[3]=n*t[3],e[4]=n*t[4],e[5]=n*t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e},z.fromTranslation=function(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=t[0],e[7]=t[1],e[8]=1,e},z.fromRotation=function(e,t){var i=Math.sin(t),r=Math.cos(t);return e[0]=r,e[1]=i,e[2]=0,e[3]=-i,e[4]=r,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e},z.fromScaling=function(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=t[1],e[5]=0,e[6]=0,e[7]=0,e[8]=1,e},z.fromMat2d=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=0,e[3]=t[2],e[4]=t[3],e[5]=0,e[6]=t[4],e[7]=t[5],e[8]=1,e},z.fromQuat=function(e,t){var i=t[0],r=t[1],n=t[2],o=t[3],s=i+i,a=r+r,l=n+n,c=i*s,h=r*s,u=r*a,d=n*s,p=n*a,f=n*l,m=o*s,_=o*a,g=o*l;return e[0]=1-u-f,e[3]=h-g,e[6]=d+_,e[1]=h+g,e[4]=1-c-f,e[7]=p-m,e[2]=d-_,e[5]=p+m,e[8]=1-c-u,e},z.normalFromMat4=function(e,t){var i=t[0],r=t[1],n=t[2],o=t[3],s=t[4],a=t[5],l=t[6],c=t[7],h=t[8],u=t[9],d=t[10],p=t[11],f=t[12],m=t[13],_=t[14],g=t[15],y=i*a-r*s,x=i*l-n*s,v=i*c-o*s,b=r*l-n*a,w=r*c-o*a,T=n*c-o*l,E=h*m-u*f,S=h*_-d*f,M=h*g-p*f,A=u*_-d*m,I=u*g-p*m,C=d*g-p*_,P=y*C-x*I+v*A+b*M-w*S+T*E;return P?(e[0]=(a*C-l*I+c*A)*(P=1/P),e[1]=(l*M-s*C-c*S)*P,e[2]=(s*I-a*M+c*E)*P,e[3]=(n*I-r*C-o*A)*P,e[4]=(i*C-n*M+o*S)*P,e[5]=(r*M-i*I-o*E)*P,e[6]=(m*T-_*w+g*b)*P,e[7]=(_*v-f*T-g*x)*P,e[8]=(f*w-m*v+g*y)*P,e):null},z.projection=function(e,t,i){return e[0]=2/t,e[1]=0,e[2]=0,e[3]=0,e[4]=-2/i,e[5]=0,e[6]=-1,e[7]=1,e[8]=1,e},z.str=function(e){return"mat3("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+", "+e[6]+", "+e[7]+", "+e[8]+")"},z.frob=function(e){return Math.hypot(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])},z.add=function(e,t,i){return e[0]=t[0]+i[0],e[1]=t[1]+i[1],e[2]=t[2]+i[2],e[3]=t[3]+i[3],e[4]=t[4]+i[4],e[5]=t[5]+i[5],e[6]=t[6]+i[6],e[7]=t[7]+i[7],e[8]=t[8]+i[8],e},z.subtract=O,z.multiplyScalar=function(e,t,i){return e[0]=t[0]*i,e[1]=t[1]*i,e[2]=t[2]*i,e[3]=t[3]*i,e[4]=t[4]*i,e[5]=t[5]*i,e[6]=t[6]*i,e[7]=t[7]*i,e[8]=t[8]*i,e},z.multiplyScalarAndAdd=function(e,t,i,r){return e[0]=t[0]+i[0]*r,e[1]=t[1]+i[1]*r,e[2]=t[2]+i[2]*r,e[3]=t[3]+i[3]*r,e[4]=t[4]+i[4]*r,e[5]=t[5]+i[5]*r,e[6]=t[6]+i[6]*r,e[7]=t[7]+i[7]*r,e[8]=t[8]+i[8]*r,e},z.exactEquals=function(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]},z.equals=function(e,t){var i=e[0],r=e[1],n=e[2],o=e[3],s=e[4],a=e[5],l=e[6],c=e[7],h=e[8],u=t[0],d=t[1],p=t[2],f=t[3],m=t[4],_=t[5],g=t[6],y=t[7],x=t[8];return Math.abs(i-u)<=R.EPSILON*Math.max(1,Math.abs(i),Math.abs(u))&&Math.abs(r-d)<=R.EPSILON*Math.max(1,Math.abs(r),Math.abs(d))&&Math.abs(n-p)<=R.EPSILON*Math.max(1,Math.abs(n),Math.abs(p))&&Math.abs(o-f)<=R.EPSILON*Math.max(1,Math.abs(o),Math.abs(f))&&Math.abs(s-m)<=R.EPSILON*Math.max(1,Math.abs(s),Math.abs(m))&&Math.abs(a-_)<=R.EPSILON*Math.max(1,Math.abs(a),Math.abs(_))&&Math.abs(l-g)<=R.EPSILON*Math.max(1,Math.abs(l),Math.abs(g))&&Math.abs(c-y)<=R.EPSILON*Math.max(1,Math.abs(c),Math.abs(y))&&Math.abs(h-x)<=R.EPSILON*Math.max(1,Math.abs(h),Math.abs(x))},z.sub=z.mul=void 0;var R=(function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==D(e)&&"function"!=typeof e)return{default:e};var t=L(void 0);if(t&&t.has(e))return t.get(e);var i={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if("default"!==n&&Object.prototype.hasOwnProperty.call(e,n)){var o=r?Object.getOwnPropertyDescriptor(e,n):null;o&&(o.get||o.set)?Object.defineProperty(i,n,o):i[n]=e[n]}return i.default=e,t&&t.set(e,i),i})(f);function L(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,i=new WeakMap;return(L=function(e){return e?i:t})(e)}function k(e,t,i){var r=t[0],n=t[1],o=t[2],s=t[3],a=t[4],l=t[5],c=t[6],h=t[7],u=t[8],d=i[0],p=i[1],f=i[2],m=i[3],_=i[4],g=i[5],y=i[6],x=i[7],v=i[8];return e[0]=d*r+p*s+f*c,e[1]=d*n+p*a+f*h,e[2]=d*o+p*l+f*u,e[3]=m*r+_*s+g*c,e[4]=m*n+_*a+g*h,e[5]=m*o+_*l+g*u,e[6]=y*r+x*s+v*c,e[7]=y*n+x*a+v*h,e[8]=y*o+x*l+v*u,e}function O(e,t,i){return e[0]=t[0]-i[0],e[1]=t[1]-i[1],e[2]=t[2]-i[2],e[3]=t[3]-i[3],e[4]=t[4]-i[4],e[5]=t[5]-i[5],e[6]=t[6]-i[6],e[7]=t[7]-i[7],e[8]=t[8]-i[8],e}z.mul=k,z.sub=O;var B={};function F(e){return F="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},F(e)}Object.defineProperty(B,"__esModule",{value:!0}),B.create=function(){var e=new N.ARRAY_TYPE(16);return N.ARRAY_TYPE!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0),e[0]=1,e[5]=1,e[10]=1,e[15]=1,e},B.clone=function(e){var t=new N.ARRAY_TYPE(16);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},B.copy=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},B.fromValues=function(e,t,i,r,n,o,s,a,l,c,h,u,d,p,f,m){var _=new N.ARRAY_TYPE(16);return _[0]=e,_[1]=t,_[2]=i,_[3]=r,_[4]=n,_[5]=o,_[6]=s,_[7]=a,_[8]=l,_[9]=c,_[10]=h,_[11]=u,_[12]=d,_[13]=p,_[14]=f,_[15]=m,_},B.set=function(e,t,i,r,n,o,s,a,l,c,h,u,d,p,f,m,_){return e[0]=t,e[1]=i,e[2]=r,e[3]=n,e[4]=o,e[5]=s,e[6]=a,e[7]=l,e[8]=c,e[9]=h,e[10]=u,e[11]=d,e[12]=p,e[13]=f,e[14]=m,e[15]=_,e},B.identity=U,B.transpose=function(e,t){if(e===t){var i=t[1],r=t[2],n=t[3],o=t[6],s=t[7],a=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=i,e[6]=t[9],e[7]=t[13],e[8]=r,e[9]=o,e[11]=t[14],e[12]=n,e[13]=s,e[14]=a}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15];return e},B.invert=function(e,t){var i=t[0],r=t[1],n=t[2],o=t[3],s=t[4],a=t[5],l=t[6],c=t[7],h=t[8],u=t[9],d=t[10],p=t[11],f=t[12],m=t[13],_=t[14],g=t[15],y=i*a-r*s,x=i*l-n*s,v=i*c-o*s,b=r*l-n*a,w=r*c-o*a,T=n*c-o*l,E=h*m-u*f,S=h*_-d*f,M=h*g-p*f,A=u*_-d*m,I=u*g-p*m,C=d*g-p*_,P=y*C-x*I+v*A+b*M-w*S+T*E;return P?(e[0]=(a*C-l*I+c*A)*(P=1/P),e[1]=(n*I-r*C-o*A)*P,e[2]=(m*T-_*w+g*b)*P,e[3]=(d*w-u*T-p*b)*P,e[4]=(l*M-s*C-c*S)*P,e[5]=(i*C-n*M+o*S)*P,e[6]=(_*v-f*T-g*x)*P,e[7]=(h*T-d*v+p*x)*P,e[8]=(s*I-a*M+c*E)*P,e[9]=(r*M-i*I-o*E)*P,e[10]=(f*w-m*v+g*y)*P,e[11]=(u*v-h*w-p*y)*P,e[12]=(a*S-s*A-l*E)*P,e[13]=(i*A-r*S+n*E)*P,e[14]=(m*x-f*b-_*y)*P,e[15]=(h*b-u*x+d*y)*P,e):null},B.adjoint=function(e,t){var i=t[0],r=t[1],n=t[2],o=t[3],s=t[4],a=t[5],l=t[6],c=t[7],h=t[8],u=t[9],d=t[10],p=t[11],f=t[12],m=t[13],_=t[14],g=t[15];return e[0]=a*(d*g-p*_)-u*(l*g-c*_)+m*(l*p-c*d),e[1]=-(r*(d*g-p*_)-u*(n*g-o*_)+m*(n*p-o*d)),e[2]=r*(l*g-c*_)-a*(n*g-o*_)+m*(n*c-o*l),e[3]=-(r*(l*p-c*d)-a*(n*p-o*d)+u*(n*c-o*l)),e[4]=-(s*(d*g-p*_)-h*(l*g-c*_)+f*(l*p-c*d)),e[5]=i*(d*g-p*_)-h*(n*g-o*_)+f*(n*p-o*d),e[6]=-(i*(l*g-c*_)-s*(n*g-o*_)+f*(n*c-o*l)),e[7]=i*(l*p-c*d)-s*(n*p-o*d)+h*(n*c-o*l),e[8]=s*(u*g-p*m)-h*(a*g-c*m)+f*(a*p-c*u),e[9]=-(i*(u*g-p*m)-h*(r*g-o*m)+f*(r*p-o*u)),e[10]=i*(a*g-c*m)-s*(r*g-o*m)+f*(r*c-o*a),e[11]=-(i*(a*p-c*u)-s*(r*p-o*u)+h*(r*c-o*a)),e[12]=-(s*(u*_-d*m)-h*(a*_-l*m)+f*(a*d-l*u)),e[13]=i*(u*_-d*m)-h*(r*_-n*m)+f*(r*d-n*u),e[14]=-(i*(a*_-l*m)-s*(r*_-n*m)+f*(r*l-n*a)),e[15]=i*(a*d-l*u)-s*(r*d-n*u)+h*(r*l-n*a),e},B.determinant=function(e){var t=e[0],i=e[1],r=e[2],n=e[3],o=e[4],s=e[5],a=e[6],l=e[7],c=e[8],h=e[9],u=e[10],d=e[11],p=e[12],f=e[13],m=e[14],_=e[15];return(t*s-i*o)*(u*_-d*m)-(t*a-r*o)*(h*_-d*f)+(t*l-n*o)*(h*m-u*f)+(i*a-r*s)*(c*_-d*p)-(i*l-n*s)*(c*m-u*p)+(r*l-n*a)*(c*f-h*p)},B.multiply=j,B.translate=function(e,t,i){var r,n,o,s,a,l,c,h,u,d,p,f,m=i[0],_=i[1],g=i[2];return t===e?(e[12]=t[0]*m+t[4]*_+t[8]*g+t[12],e[13]=t[1]*m+t[5]*_+t[9]*g+t[13],e[14]=t[2]*m+t[6]*_+t[10]*g+t[14],e[15]=t[3]*m+t[7]*_+t[11]*g+t[15]):(n=t[1],o=t[2],s=t[3],a=t[4],l=t[5],c=t[6],h=t[7],u=t[8],d=t[9],p=t[10],f=t[11],e[0]=r=t[0],e[1]=n,e[2]=o,e[3]=s,e[4]=a,e[5]=l,e[6]=c,e[7]=h,e[8]=u,e[9]=d,e[10]=p,e[11]=f,e[12]=r*m+a*_+u*g+t[12],e[13]=n*m+l*_+d*g+t[13],e[14]=o*m+c*_+p*g+t[14],e[15]=s*m+h*_+f*g+t[15]),e},B.scale=function(e,t,i){var r=i[0],n=i[1],o=i[2];return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e[8]=t[8]*o,e[9]=t[9]*o,e[10]=t[10]*o,e[11]=t[11]*o,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},B.rotate=function(e,t,i,r){var n,o,s,a,l,c,h,u,d,p,f,m,_,g,y,x,v,b,w,T,E,S,M,A,I=r[0],C=r[1],P=r[2],z=Math.hypot(I,C,P);return z0?(i[0]=2*(a*s+h*r+l*o-c*n)/u,i[1]=2*(l*s+h*n+c*r-a*o)/u,i[2]=2*(c*s+h*o+a*n-l*r)/u):(i[0]=2*(a*s+h*r+l*o-c*n),i[1]=2*(l*s+h*n+c*r-a*o),i[2]=2*(c*s+h*o+a*n-l*r)),$(e,t,i),e},B.getTranslation=function(e,t){return e[0]=t[12],e[1]=t[13],e[2]=t[14],e},B.getScaling=G,B.getRotation=function(e,t){var i=new N.ARRAY_TYPE(3);G(i,t);var r=1/i[0],n=1/i[1],o=1/i[2],s=t[0]*r,a=t[1]*n,l=t[2]*o,c=t[4]*r,h=t[5]*n,u=t[6]*o,d=t[8]*r,p=t[9]*n,f=t[10]*o,m=s+h+f,_=0;return m>0?(_=2*Math.sqrt(m+1),e[3]=.25*_,e[0]=(u-p)/_,e[1]=(d-l)/_,e[2]=(a-c)/_):s>h&&s>f?(_=2*Math.sqrt(1+s-h-f),e[3]=(u-p)/_,e[0]=.25*_,e[1]=(a+c)/_,e[2]=(d+l)/_):h>f?(_=2*Math.sqrt(1+h-s-f),e[3]=(d-l)/_,e[0]=(a+c)/_,e[1]=.25*_,e[2]=(u+p)/_):(_=2*Math.sqrt(1+f-s-h),e[3]=(a-c)/_,e[0]=(d+l)/_,e[1]=(u+p)/_,e[2]=.25*_),e},B.fromRotationTranslationScale=function(e,t,i,r){var n=t[0],o=t[1],s=t[2],a=t[3],l=n+n,c=o+o,h=s+s,u=n*l,d=n*c,p=n*h,f=o*c,m=o*h,_=s*h,g=a*l,y=a*c,x=a*h,v=r[0],b=r[1],w=r[2];return e[0]=(1-(f+_))*v,e[1]=(d+x)*v,e[2]=(p-y)*v,e[3]=0,e[4]=(d-x)*b,e[5]=(1-(u+_))*b,e[6]=(m+g)*b,e[7]=0,e[8]=(p+y)*w,e[9]=(m-g)*w,e[10]=(1-(u+f))*w,e[11]=0,e[12]=i[0],e[13]=i[1],e[14]=i[2],e[15]=1,e},B.fromRotationTranslationScaleOrigin=function(e,t,i,r,n){var o=t[0],s=t[1],a=t[2],l=t[3],c=o+o,h=s+s,u=a+a,d=o*c,p=o*h,f=o*u,m=s*h,_=s*u,g=a*u,y=l*c,x=l*h,v=l*u,b=r[0],w=r[1],T=r[2],E=n[0],S=n[1],M=n[2],A=(1-(m+g))*b,I=(p+v)*b,C=(f-x)*b,P=(p-v)*w,z=(1-(d+g))*w,D=(_+y)*w,R=(f+x)*T,L=(_-y)*T,k=(1-(d+m))*T;return e[0]=A,e[1]=I,e[2]=C,e[3]=0,e[4]=P,e[5]=z,e[6]=D,e[7]=0,e[8]=R,e[9]=L,e[10]=k,e[11]=0,e[12]=i[0]+E-(A*E+P*S+R*M),e[13]=i[1]+S-(I*E+z*S+L*M),e[14]=i[2]+M-(C*E+D*S+k*M),e[15]=1,e},B.fromQuat=function(e,t){var i=t[0],r=t[1],n=t[2],o=t[3],s=i+i,a=r+r,l=n+n,c=i*s,h=r*s,u=r*a,d=n*s,p=n*a,f=n*l,m=o*s,_=o*a,g=o*l;return e[0]=1-u-f,e[1]=h+g,e[2]=d-_,e[3]=0,e[4]=h-g,e[5]=1-c-f,e[6]=p+m,e[7]=0,e[8]=d+_,e[9]=p-m,e[10]=1-c-u,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e},B.frustum=function(e,t,i,r,n,o,s){var a=1/(i-t),l=1/(n-r),c=1/(o-s);return e[0]=2*o*a,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=2*o*l,e[6]=0,e[7]=0,e[8]=(i+t)*a,e[9]=(n+r)*l,e[10]=(s+o)*c,e[11]=-1,e[12]=0,e[13]=0,e[14]=s*o*2*c,e[15]=0,e},B.perspectiveNO=q,B.perspectiveZO=function(e,t,i,r,n){var o,s=1/Math.tan(t/2);return e[0]=s/i,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=s,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,null!=n&&n!==1/0?(e[10]=n*(o=1/(r-n)),e[14]=n*r*o):(e[10]=-1,e[14]=-r),e},B.perspectiveFromFieldOfView=function(e,t,i,r){var n=Math.tan(t.upDegrees*Math.PI/180),o=Math.tan(t.downDegrees*Math.PI/180),s=Math.tan(t.leftDegrees*Math.PI/180),a=Math.tan(t.rightDegrees*Math.PI/180),l=2/(s+a),c=2/(n+o);return e[0]=l,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=c,e[6]=0,e[7]=0,e[8]=-(s-a)*l*.5,e[9]=(n-o)*c*.5,e[10]=r/(i-r),e[11]=-1,e[12]=0,e[13]=0,e[14]=r*i/(i-r),e[15]=0,e},B.orthoNO=Z,B.orthoZO=function(e,t,i,r,n,o,s){var a=1/(t-i),l=1/(r-n),c=1/(o-s);return e[0]=-2*a,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*l,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=c,e[11]=0,e[12]=(t+i)*a,e[13]=(n+r)*l,e[14]=o*c,e[15]=1,e},B.lookAt=function(e,t,i,r){var n,o,s,a,l,c,h,u,d,p,f=t[0],m=t[1],_=t[2],g=r[0],y=r[1],x=r[2],v=i[0],b=i[1],w=i[2];return Math.abs(f-v)0&&(h*=p=1/Math.sqrt(p),u*=p,d*=p);var f=l*d-c*u,m=c*h-a*d,_=a*u-l*h;return(p=f*f+m*m+_*_)>0&&(f*=p=1/Math.sqrt(p),m*=p,_*=p),e[0]=f,e[1]=m,e[2]=_,e[3]=0,e[4]=u*_-d*m,e[5]=d*f-h*_,e[6]=h*m-u*f,e[7]=0,e[8]=h,e[9]=u,e[10]=d,e[11]=0,e[12]=n,e[13]=o,e[14]=s,e[15]=1,e},B.str=function(e){return"mat4("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+", "+e[6]+", "+e[7]+", "+e[8]+", "+e[9]+", "+e[10]+", "+e[11]+", "+e[12]+", "+e[13]+", "+e[14]+", "+e[15]+")"},B.frob=function(e){return Math.hypot(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])},B.add=function(e,t,i){return e[0]=t[0]+i[0],e[1]=t[1]+i[1],e[2]=t[2]+i[2],e[3]=t[3]+i[3],e[4]=t[4]+i[4],e[5]=t[5]+i[5],e[6]=t[6]+i[6],e[7]=t[7]+i[7],e[8]=t[8]+i[8],e[9]=t[9]+i[9],e[10]=t[10]+i[10],e[11]=t[11]+i[11],e[12]=t[12]+i[12],e[13]=t[13]+i[13],e[14]=t[14]+i[14],e[15]=t[15]+i[15],e},B.subtract=W,B.multiplyScalar=function(e,t,i){return e[0]=t[0]*i,e[1]=t[1]*i,e[2]=t[2]*i,e[3]=t[3]*i,e[4]=t[4]*i,e[5]=t[5]*i,e[6]=t[6]*i,e[7]=t[7]*i,e[8]=t[8]*i,e[9]=t[9]*i,e[10]=t[10]*i,e[11]=t[11]*i,e[12]=t[12]*i,e[13]=t[13]*i,e[14]=t[14]*i,e[15]=t[15]*i,e},B.multiplyScalarAndAdd=function(e,t,i,r){return e[0]=t[0]+i[0]*r,e[1]=t[1]+i[1]*r,e[2]=t[2]+i[2]*r,e[3]=t[3]+i[3]*r,e[4]=t[4]+i[4]*r,e[5]=t[5]+i[5]*r,e[6]=t[6]+i[6]*r,e[7]=t[7]+i[7]*r,e[8]=t[8]+i[8]*r,e[9]=t[9]+i[9]*r,e[10]=t[10]+i[10]*r,e[11]=t[11]+i[11]*r,e[12]=t[12]+i[12]*r,e[13]=t[13]+i[13]*r,e[14]=t[14]+i[14]*r,e[15]=t[15]+i[15]*r,e},B.exactEquals=function(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[11]===t[11]&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[15]===t[15]},B.equals=function(e,t){var i=e[0],r=e[1],n=e[2],o=e[3],s=e[4],a=e[5],l=e[6],c=e[7],h=e[8],u=e[9],d=e[10],p=e[11],f=e[12],m=e[13],_=e[14],g=e[15],y=t[0],x=t[1],v=t[2],b=t[3],w=t[4],T=t[5],E=t[6],S=t[7],M=t[8],A=t[9],I=t[10],C=t[11],P=t[12],z=t[13],D=t[14],R=t[15];return Math.abs(i-y)<=N.EPSILON*Math.max(1,Math.abs(i),Math.abs(y))&&Math.abs(r-x)<=N.EPSILON*Math.max(1,Math.abs(r),Math.abs(x))&&Math.abs(n-v)<=N.EPSILON*Math.max(1,Math.abs(n),Math.abs(v))&&Math.abs(o-b)<=N.EPSILON*Math.max(1,Math.abs(o),Math.abs(b))&&Math.abs(s-w)<=N.EPSILON*Math.max(1,Math.abs(s),Math.abs(w))&&Math.abs(a-T)<=N.EPSILON*Math.max(1,Math.abs(a),Math.abs(T))&&Math.abs(l-E)<=N.EPSILON*Math.max(1,Math.abs(l),Math.abs(E))&&Math.abs(c-S)<=N.EPSILON*Math.max(1,Math.abs(c),Math.abs(S))&&Math.abs(h-M)<=N.EPSILON*Math.max(1,Math.abs(h),Math.abs(M))&&Math.abs(u-A)<=N.EPSILON*Math.max(1,Math.abs(u),Math.abs(A))&&Math.abs(d-I)<=N.EPSILON*Math.max(1,Math.abs(d),Math.abs(I))&&Math.abs(p-C)<=N.EPSILON*Math.max(1,Math.abs(p),Math.abs(C))&&Math.abs(f-P)<=N.EPSILON*Math.max(1,Math.abs(f),Math.abs(P))&&Math.abs(m-z)<=N.EPSILON*Math.max(1,Math.abs(m),Math.abs(z))&&Math.abs(_-D)<=N.EPSILON*Math.max(1,Math.abs(_),Math.abs(D))&&Math.abs(g-R)<=N.EPSILON*Math.max(1,Math.abs(g),Math.abs(R))},B.sub=B.mul=B.ortho=B.perspective=void 0;var N=(function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==F(e)&&"function"!=typeof e)return{default:e};var t=V(void 0);if(t&&t.has(e))return t.get(e);var i={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if("default"!==n&&Object.prototype.hasOwnProperty.call(e,n)){var o=r?Object.getOwnPropertyDescriptor(e,n):null;o&&(o.get||o.set)?Object.defineProperty(i,n,o):i[n]=e[n]}return i.default=e,t&&t.set(e,i),i})(f);function V(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,i=new WeakMap;return(V=function(e){return e?i:t})(e)}function U(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function j(e,t,i){var r=t[0],n=t[1],o=t[2],s=t[3],a=t[4],l=t[5],c=t[6],h=t[7],u=t[8],d=t[9],p=t[10],f=t[11],m=t[12],_=t[13],g=t[14],y=t[15],x=i[0],v=i[1],b=i[2],w=i[3];return e[0]=x*r+v*a+b*u+w*m,e[1]=x*n+v*l+b*d+w*_,e[2]=x*o+v*c+b*p+w*g,e[3]=x*s+v*h+b*f+w*y,e[4]=(x=i[4])*r+(v=i[5])*a+(b=i[6])*u+(w=i[7])*m,e[5]=x*n+v*l+b*d+w*_,e[6]=x*o+v*c+b*p+w*g,e[7]=x*s+v*h+b*f+w*y,e[8]=(x=i[8])*r+(v=i[9])*a+(b=i[10])*u+(w=i[11])*m,e[9]=x*n+v*l+b*d+w*_,e[10]=x*o+v*c+b*p+w*g,e[11]=x*s+v*h+b*f+w*y,e[12]=(x=i[12])*r+(v=i[13])*a+(b=i[14])*u+(w=i[15])*m,e[13]=x*n+v*l+b*d+w*_,e[14]=x*o+v*c+b*p+w*g,e[15]=x*s+v*h+b*f+w*y,e}function $(e,t,i){var r=t[0],n=t[1],o=t[2],s=t[3],a=r+r,l=n+n,c=o+o,h=r*a,u=r*l,d=r*c,p=n*l,f=n*c,m=o*c,_=s*a,g=s*l,y=s*c;return e[0]=1-(p+m),e[1]=u+y,e[2]=d-g,e[3]=0,e[4]=u-y,e[5]=1-(h+m),e[6]=f+_,e[7]=0,e[8]=d+g,e[9]=f-_,e[10]=1-(h+p),e[11]=0,e[12]=i[0],e[13]=i[1],e[14]=i[2],e[15]=1,e}function G(e,t){var i=t[4],r=t[5],n=t[6],o=t[8],s=t[9],a=t[10];return e[0]=Math.hypot(t[0],t[1],t[2]),e[1]=Math.hypot(i,r,n),e[2]=Math.hypot(o,s,a),e}function q(e,t,i,r,n){var o,s=1/Math.tan(t/2);return e[0]=s/i,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=s,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,null!=n&&n!==1/0?(e[10]=(n+r)*(o=1/(r-n)),e[14]=2*n*r*o):(e[10]=-1,e[14]=-2*r),e}function Z(e,t,i,r,n,o,s){var a=1/(t-i),l=1/(r-n),c=1/(o-s);return e[0]=-2*a,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*l,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*c,e[11]=0,e[12]=(t+i)*a,e[13]=(n+r)*l,e[14]=(s+o)*c,e[15]=1,e}function W(e,t,i){return e[0]=t[0]-i[0],e[1]=t[1]-i[1],e[2]=t[2]-i[2],e[3]=t[3]-i[3],e[4]=t[4]-i[4],e[5]=t[5]-i[5],e[6]=t[6]-i[6],e[7]=t[7]-i[7],e[8]=t[8]-i[8],e[9]=t[9]-i[9],e[10]=t[10]-i[10],e[11]=t[11]-i[11],e[12]=t[12]-i[12],e[13]=t[13]-i[13],e[14]=t[14]-i[14],e[15]=t[15]-i[15],e}B.perspective=q,B.ortho=Z,B.mul=j,B.sub=W;var H={},X={};function Y(e){return Y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Y(e)}Object.defineProperty(X,"__esModule",{value:!0}),X.create=Q,X.clone=function(e){var t=new J.ARRAY_TYPE(3);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t},X.length=ee,X.fromValues=function(e,t,i){var r=new J.ARRAY_TYPE(3);return r[0]=e,r[1]=t,r[2]=i,r},X.copy=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e},X.set=function(e,t,i,r){return e[0]=t,e[1]=i,e[2]=r,e},X.add=function(e,t,i){return e[0]=t[0]+i[0],e[1]=t[1]+i[1],e[2]=t[2]+i[2],e},X.subtract=te,X.multiply=ie,X.divide=re,X.ceil=function(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e},X.floor=function(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e},X.min=function(e,t,i){return e[0]=Math.min(t[0],i[0]),e[1]=Math.min(t[1],i[1]),e[2]=Math.min(t[2],i[2]),e},X.max=function(e,t,i){return e[0]=Math.max(t[0],i[0]),e[1]=Math.max(t[1],i[1]),e[2]=Math.max(t[2],i[2]),e},X.round=function(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e[2]=Math.round(t[2]),e},X.scale=function(e,t,i){return e[0]=t[0]*i,e[1]=t[1]*i,e[2]=t[2]*i,e},X.scaleAndAdd=function(e,t,i,r){return e[0]=t[0]+i[0]*r,e[1]=t[1]+i[1]*r,e[2]=t[2]+i[2]*r,e},X.distance=ne,X.squaredDistance=oe,X.squaredLength=se,X.negate=function(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e},X.inverse=function(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e},X.normalize=function(e,t){var i=t[0],r=t[1],n=t[2],o=i*i+r*r+n*n;return o>0&&(o=1/Math.sqrt(o)),e[0]=t[0]*o,e[1]=t[1]*o,e[2]=t[2]*o,e},X.dot=ae,X.cross=function(e,t,i){var r=t[0],n=t[1],o=t[2],s=i[0],a=i[1],l=i[2];return e[0]=n*l-o*a,e[1]=o*s-r*l,e[2]=r*a-n*s,e},X.lerp=function(e,t,i,r){var n=t[0],o=t[1],s=t[2];return e[0]=n+r*(i[0]-n),e[1]=o+r*(i[1]-o),e[2]=s+r*(i[2]-s),e},X.hermite=function(e,t,i,r,n,o){var s=o*o,a=s*(2*o-3)+1,l=s*(o-2)+o,c=s*(o-1),h=s*(3-2*o);return e[0]=t[0]*a+i[0]*l+r[0]*c+n[0]*h,e[1]=t[1]*a+i[1]*l+r[1]*c+n[1]*h,e[2]=t[2]*a+i[2]*l+r[2]*c+n[2]*h,e},X.bezier=function(e,t,i,r,n,o){var s=1-o,a=s*s,l=o*o,c=a*s,h=3*o*a,u=3*l*s,d=l*o;return e[0]=t[0]*c+i[0]*h+r[0]*u+n[0]*d,e[1]=t[1]*c+i[1]*h+r[1]*u+n[1]*d,e[2]=t[2]*c+i[2]*h+r[2]*u+n[2]*d,e},X.random=function(e,t){t=t||1;var i=2*J.RANDOM()*Math.PI,r=2*J.RANDOM()-1,n=Math.sqrt(1-r*r)*t;return e[0]=Math.cos(i)*n,e[1]=Math.sin(i)*n,e[2]=r*t,e},X.transformMat4=function(e,t,i){var r=t[0],n=t[1],o=t[2],s=i[3]*r+i[7]*n+i[11]*o+i[15];return e[0]=(i[0]*r+i[4]*n+i[8]*o+i[12])/(s=s||1),e[1]=(i[1]*r+i[5]*n+i[9]*o+i[13])/s,e[2]=(i[2]*r+i[6]*n+i[10]*o+i[14])/s,e},X.transformMat3=function(e,t,i){var r=t[0],n=t[1],o=t[2];return e[0]=r*i[0]+n*i[3]+o*i[6],e[1]=r*i[1]+n*i[4]+o*i[7],e[2]=r*i[2]+n*i[5]+o*i[8],e},X.transformQuat=function(e,t,i){var r=i[0],n=i[1],o=i[2],s=t[0],a=t[1],l=t[2],c=n*l-o*a,h=o*s-r*l,u=r*a-n*s,d=n*u-o*h,p=o*c-r*u,f=r*h-n*c,m=2*i[3];return h*=m,u*=m,p*=2,f*=2,e[0]=s+(c*=m)+(d*=2),e[1]=a+h+p,e[2]=l+u+f,e},X.rotateX=function(e,t,i,r){var n=[],o=[];return n[0]=t[0]-i[0],n[1]=t[1]-i[1],n[2]=t[2]-i[2],o[0]=n[0],o[1]=n[1]*Math.cos(r)-n[2]*Math.sin(r),o[2]=n[1]*Math.sin(r)+n[2]*Math.cos(r),e[0]=o[0]+i[0],e[1]=o[1]+i[1],e[2]=o[2]+i[2],e},X.rotateY=function(e,t,i,r){var n=[],o=[];return n[0]=t[0]-i[0],n[1]=t[1]-i[1],n[2]=t[2]-i[2],o[0]=n[2]*Math.sin(r)+n[0]*Math.cos(r),o[1]=n[1],o[2]=n[2]*Math.cos(r)-n[0]*Math.sin(r),e[0]=o[0]+i[0],e[1]=o[1]+i[1],e[2]=o[2]+i[2],e},X.rotateZ=function(e,t,i,r){var n=[],o=[];return n[0]=t[0]-i[0],n[1]=t[1]-i[1],n[2]=t[2]-i[2],o[0]=n[0]*Math.cos(r)-n[1]*Math.sin(r),o[1]=n[0]*Math.sin(r)+n[1]*Math.cos(r),o[2]=n[2],e[0]=o[0]+i[0],e[1]=o[1]+i[1],e[2]=o[2]+i[2],e},X.angle=function(e,t){var i=e[0],r=e[1],n=e[2],o=t[0],s=t[1],a=t[2],l=Math.sqrt(i*i+r*r+n*n)*Math.sqrt(o*o+s*s+a*a),c=l&&ae(e,t)/l;return Math.acos(Math.min(Math.max(c,-1),1))},X.zero=function(e){return e[0]=0,e[1]=0,e[2]=0,e},X.str=function(e){return"vec3("+e[0]+", "+e[1]+", "+e[2]+")"},X.exactEquals=function(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]},X.equals=function(e,t){var i=e[0],r=e[1],n=e[2],o=t[0],s=t[1],a=t[2];return Math.abs(i-o)<=J.EPSILON*Math.max(1,Math.abs(i),Math.abs(o))&&Math.abs(r-s)<=J.EPSILON*Math.max(1,Math.abs(r),Math.abs(s))&&Math.abs(n-a)<=J.EPSILON*Math.max(1,Math.abs(n),Math.abs(a))},X.forEach=X.sqrLen=X.len=X.sqrDist=X.dist=X.div=X.mul=X.sub=void 0;var J=(function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==Y(e)&&"function"!=typeof e)return{default:e};var t=K(void 0);if(t&&t.has(e))return t.get(e);var i={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if("default"!==n&&Object.prototype.hasOwnProperty.call(e,n)){var o=r?Object.getOwnPropertyDescriptor(e,n):null;o&&(o.get||o.set)?Object.defineProperty(i,n,o):i[n]=e[n]}return i.default=e,t&&t.set(e,i),i})(f);function K(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,i=new WeakMap;return(K=function(e){return e?i:t})(e)}function Q(){var e=new J.ARRAY_TYPE(3);return J.ARRAY_TYPE!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function ee(e){return Math.hypot(e[0],e[1],e[2])}function te(e,t,i){return e[0]=t[0]-i[0],e[1]=t[1]-i[1],e[2]=t[2]-i[2],e}function ie(e,t,i){return e[0]=t[0]*i[0],e[1]=t[1]*i[1],e[2]=t[2]*i[2],e}function re(e,t,i){return e[0]=t[0]/i[0],e[1]=t[1]/i[1],e[2]=t[2]/i[2],e}function ne(e,t){return Math.hypot(t[0]-e[0],t[1]-e[1],t[2]-e[2])}function oe(e,t){var i=t[0]-e[0],r=t[1]-e[1],n=t[2]-e[2];return i*i+r*r+n*n}function se(e){var t=e[0],i=e[1],r=e[2];return t*t+i*i+r*r}function ae(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}X.sub=te,X.mul=ie,X.div=re,X.dist=ne,X.sqrDist=oe,X.len=ee,X.sqrLen=se;var le,ce=(le=Q(),function(e,t,i,r,n,o){var s,a;for(t||(t=3),i||(i=0),a=r?Math.min(r*t+i,e.length):e.length,s=i;s0&&(s=1/Math.sqrt(s)),e[0]=i*s,e[1]=r*s,e[2]=n*s,e[3]=o*s,e},he.dot=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]},he.cross=function(e,t,i,r){var n=i[0]*r[1]-i[1]*r[0],o=i[0]*r[2]-i[2]*r[0],s=i[0]*r[3]-i[3]*r[0],a=i[1]*r[2]-i[2]*r[1],l=i[1]*r[3]-i[3]*r[1],c=i[2]*r[3]-i[3]*r[2],h=t[0],u=t[1],d=t[2],p=t[3];return e[0]=u*c-d*l+p*a,e[1]=-h*c+d*s-p*o,e[2]=h*l-u*s+p*n,e[3]=-h*a+u*o-d*n,e},he.lerp=function(e,t,i,r){var n=t[0],o=t[1],s=t[2],a=t[3];return e[0]=n+r*(i[0]-n),e[1]=o+r*(i[1]-o),e[2]=s+r*(i[2]-s),e[3]=a+r*(i[3]-a),e},he.random=function(e,t){var i,r,n,o,s,a;t=t||1;do{s=(i=2*de.RANDOM()-1)*i+(r=2*de.RANDOM()-1)*r}while(s>=1);do{a=(n=2*de.RANDOM()-1)*n+(o=2*de.RANDOM()-1)*o}while(a>=1);var l=Math.sqrt((1-s)/a);return e[0]=t*i,e[1]=t*r,e[2]=t*n*l,e[3]=t*o*l,e},he.transformMat4=function(e,t,i){var r=t[0],n=t[1],o=t[2],s=t[3];return e[0]=i[0]*r+i[4]*n+i[8]*o+i[12]*s,e[1]=i[1]*r+i[5]*n+i[9]*o+i[13]*s,e[2]=i[2]*r+i[6]*n+i[10]*o+i[14]*s,e[3]=i[3]*r+i[7]*n+i[11]*o+i[15]*s,e},he.transformQuat=function(e,t,i){var r=t[0],n=t[1],o=t[2],s=i[0],a=i[1],l=i[2],c=i[3],h=c*r+a*o-l*n,u=c*n+l*r-s*o,d=c*o+s*n-a*r,p=-s*r-a*n-l*o;return e[0]=h*c+p*-s+u*-l-d*-a,e[1]=u*c+p*-a+d*-s-h*-l,e[2]=d*c+p*-l+h*-a-u*-s,e[3]=t[3],e},he.zero=function(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=0,e},he.str=function(e){return"vec4("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+")"},he.exactEquals=function(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]},he.equals=function(e,t){var i=e[0],r=e[1],n=e[2],o=e[3],s=t[0],a=t[1],l=t[2],c=t[3];return Math.abs(i-s)<=de.EPSILON*Math.max(1,Math.abs(i),Math.abs(s))&&Math.abs(r-a)<=de.EPSILON*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(n-l)<=de.EPSILON*Math.max(1,Math.abs(n),Math.abs(l))&&Math.abs(o-c)<=de.EPSILON*Math.max(1,Math.abs(o),Math.abs(c))},he.forEach=he.sqrLen=he.len=he.sqrDist=he.dist=he.div=he.mul=he.sub=void 0;var de=(function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==ue(e)&&"function"!=typeof e)return{default:e};var t=pe(void 0);if(t&&t.has(e))return t.get(e);var i={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if("default"!==n&&Object.prototype.hasOwnProperty.call(e,n)){var o=r?Object.getOwnPropertyDescriptor(e,n):null;o&&(o.get||o.set)?Object.defineProperty(i,n,o):i[n]=e[n]}return i.default=e,t&&t.set(e,i),i})(f);function pe(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,i=new WeakMap;return(pe=function(e){return e?i:t})(e)}function fe(){var e=new de.ARRAY_TYPE(4);return de.ARRAY_TYPE!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[3]=0),e}function me(e,t,i){return e[0]=t[0]-i[0],e[1]=t[1]-i[1],e[2]=t[2]-i[2],e[3]=t[3]-i[3],e}function _e(e,t,i){return e[0]=t[0]*i[0],e[1]=t[1]*i[1],e[2]=t[2]*i[2],e[3]=t[3]*i[3],e}function ge(e,t,i){return e[0]=t[0]/i[0],e[1]=t[1]/i[1],e[2]=t[2]/i[2],e[3]=t[3]/i[3],e}function ye(e,t){return Math.hypot(t[0]-e[0],t[1]-e[1],t[2]-e[2],t[3]-e[3])}function xe(e,t){var i=t[0]-e[0],r=t[1]-e[1],n=t[2]-e[2],o=t[3]-e[3];return i*i+r*r+n*n+o*o}function ve(e){return Math.hypot(e[0],e[1],e[2],e[3])}function be(e){var t=e[0],i=e[1],r=e[2],n=e[3];return t*t+i*i+r*r+n*n}he.sub=me,he.mul=_e,he.div=ge,he.dist=ye,he.sqrDist=xe,he.len=ve,he.sqrLen=be;var we=(function(){var e=fe();return function(t,i,r,n,o,s){var a,l;for(i||(i=4),r||(r=0),l=n?Math.min(n*i+r,t.length):t.length,a=r;aEe.EPSILON?(e[0]=t[0]/r,e[1]=t[1]/r,e[2]=t[2]/r):(e[0]=1,e[1]=0,e[2]=0),i},H.getAngle=function(e,t){var i=Fe(e,t);return Math.acos(2*i*i-1)},H.multiply=De,H.rotateX=function(e,t,i){i*=.5;var r=t[0],n=t[1],o=t[2],s=t[3],a=Math.sin(i),l=Math.cos(i);return e[0]=r*l+s*a,e[1]=n*l+o*a,e[2]=o*l-n*a,e[3]=s*l-r*a,e},H.rotateY=function(e,t,i){i*=.5;var r=t[0],n=t[1],o=t[2],s=t[3],a=Math.sin(i),l=Math.cos(i);return e[0]=r*l-o*a,e[1]=n*l+s*a,e[2]=o*l+r*a,e[3]=s*l-n*a,e},H.rotateZ=function(e,t,i){i*=.5;var r=t[0],n=t[1],o=t[2],s=t[3],a=Math.sin(i),l=Math.cos(i);return e[0]=r*l+n*a,e[1]=n*l-r*a,e[2]=o*l+s*a,e[3]=s*l-o*a,e},H.calculateW=function(e,t){var i=t[0],r=t[1],n=t[2];return e[0]=i,e[1]=r,e[2]=n,e[3]=Math.sqrt(Math.abs(1-i*i-r*r-n*n)),e},H.exp=Re,H.ln=Le,H.pow=function(e,t,i){return Le(e,t),Be(e,e,i),Re(e,e),e},H.slerp=ke,H.random=function(e){var t=Ee.RANDOM(),i=Ee.RANDOM(),r=Ee.RANDOM(),n=Math.sqrt(1-t),o=Math.sqrt(t);return e[0]=n*Math.sin(2*Math.PI*i),e[1]=n*Math.cos(2*Math.PI*i),e[2]=o*Math.sin(2*Math.PI*r),e[3]=o*Math.cos(2*Math.PI*r),e},H.invert=function(e,t){var i=t[0],r=t[1],n=t[2],o=t[3],s=i*i+r*r+n*n+o*o,a=s?1/s:0;return e[0]=-i*a,e[1]=-r*a,e[2]=-n*a,e[3]=o*a,e},H.conjugate=function(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e},H.fromMat3=Oe,H.fromEuler=function(e,t,i,r){var n=.5*Math.PI/180;t*=n,i*=n,r*=n;var o=Math.sin(t),s=Math.cos(t),a=Math.sin(i),l=Math.cos(i),c=Math.sin(r),h=Math.cos(r);return e[0]=o*l*h-s*a*c,e[1]=s*a*h+o*l*c,e[2]=s*l*c-o*a*h,e[3]=s*l*h+o*a*c,e},H.str=function(e){return"quat("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+")"},H.setAxes=H.sqlerp=H.rotationTo=H.equals=H.exactEquals=H.normalize=H.sqrLen=H.squaredLength=H.len=H.length=H.lerp=H.dot=H.scale=H.mul=H.add=H.set=H.copy=H.fromValues=H.clone=void 0;var Ee=Ce(f),Se=Ce(z),Me=Ce(X),Ae=Ce(he);function Ie(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,i=new WeakMap;return(Ie=function(e){return e?i:t})(e)}function Ce(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!==Te(e)&&"function"!=typeof e)return{default:e};var i=Ie(t);if(i&&i.has(e))return i.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var s=n?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(r,o,s):r[o]=e[o]}return r.default=e,i&&i.set(e,r),r}function Pe(){var e=new Ee.ARRAY_TYPE(4);return Ee.ARRAY_TYPE!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e[3]=1,e}function ze(e,t,i){i*=.5;var r=Math.sin(i);return e[0]=r*t[0],e[1]=r*t[1],e[2]=r*t[2],e[3]=Math.cos(i),e}function De(e,t,i){var r=t[0],n=t[1],o=t[2],s=t[3],a=i[0],l=i[1],c=i[2],h=i[3];return e[0]=r*h+s*a+n*c-o*l,e[1]=n*h+s*l+o*a-r*c,e[2]=o*h+s*c+r*l-n*a,e[3]=s*h-r*a-n*l-o*c,e}function Re(e,t){var i=t[0],r=t[1],n=t[2],o=t[3],s=Math.sqrt(i*i+r*r+n*n),a=Math.exp(o),l=s>0?a*Math.sin(s)/s:0;return e[0]=i*l,e[1]=r*l,e[2]=n*l,e[3]=a*Math.cos(s),e}function Le(e,t){var i=t[0],r=t[1],n=t[2],o=t[3],s=Math.sqrt(i*i+r*r+n*n),a=s>0?Math.atan2(s,o)/s:0;return e[0]=i*a,e[1]=r*a,e[2]=n*a,e[3]=.5*Math.log(i*i+r*r+n*n+o*o),e}function ke(e,t,i,r){var n,o,s,a,l,c=t[0],h=t[1],u=t[2],d=t[3],p=i[0],f=i[1],m=i[2],_=i[3];return(o=c*p+h*f+u*m+d*_)<0&&(o=-o,p=-p,f=-f,m=-m,_=-_),1-o>Ee.EPSILON?(n=Math.acos(o),s=Math.sin(n),a=Math.sin((1-r)*n)/s,l=Math.sin(r*n)/s):(a=1-r,l=r),e[0]=a*c+l*p,e[1]=a*h+l*f,e[2]=a*u+l*m,e[3]=a*d+l*_,e}function Oe(e,t){var i,r=t[0]+t[4]+t[8];if(r>0)i=Math.sqrt(r+1),e[3]=.5*i,e[0]=(t[5]-t[7])*(i=.5/i),e[1]=(t[6]-t[2])*i,e[2]=(t[1]-t[3])*i;else{var n=0;t[4]>t[0]&&(n=1),t[8]>t[3*n+n]&&(n=2);var o=(n+1)%3,s=(n+2)%3;i=Math.sqrt(t[3*n+n]-t[3*o+o]-t[3*s+s]+1),e[n]=.5*i,e[3]=(t[3*o+s]-t[3*s+o])*(i=.5/i),e[o]=(t[3*o+n]+t[3*n+o])*i,e[s]=(t[3*s+n]+t[3*n+s])*i}return e}H.clone=Ae.clone,H.fromValues=Ae.fromValues,H.copy=Ae.copy,H.set=Ae.set,H.add=Ae.add,H.mul=De;var Be=Ae.scale;H.scale=Be;var Fe=Ae.dot;H.dot=Fe,H.lerp=Ae.lerp;var Ne=Ae.length;H.length=Ne,H.len=Ne;var Ve=Ae.squaredLength;H.squaredLength=Ve,H.sqrLen=Ve;var Ue=Ae.normalize;H.normalize=Ue,H.exactEquals=Ae.exactEquals,H.equals=Ae.equals;var je,$e,Ge,qe=(je=Me.create(),$e=Me.fromValues(1,0,0),Ge=Me.fromValues(0,1,0),function(e,t,i){var r=Me.dot(t,i);return r<-.999999?(Me.cross(je,$e,t),Me.len(je)<1e-6&&Me.cross(je,Ge,t),Me.normalize(je,je),ze(e,je,Math.PI),e):r>.999999?(e[0]=0,e[1]=0,e[2]=0,e[3]=1,e):(Me.cross(je,t,i),e[0]=je[0],e[1]=je[1],e[2]=je[2],e[3]=1+r,Ue(e,e))});H.rotationTo=qe;var Ze,We,He=(Ze=Pe(),We=Pe(),function(e,t,i,r,n,o){return ke(Ze,t,n,o),ke(We,i,r,o),ke(e,Ze,We,2*o*(1-o)),e});H.sqlerp=He;var Xe,Ye=(Xe=Se.create(),function(e,t,i,r){return Xe[0]=i[0],Xe[3]=i[1],Xe[6]=i[2],Xe[1]=r[0],Xe[4]=r[1],Xe[7]=r[2],Xe[2]=-t[0],Xe[5]=-t[1],Xe[8]=-t[2],Ue(e,Oe(e,Xe))});H.setAxes=Ye;var Je={};function Ke(e){return Ke="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ke(e)}Object.defineProperty(Je,"__esModule",{value:!0}),Je.create=function(){var e=new Qe.ARRAY_TYPE(8);return Qe.ARRAY_TYPE!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[4]=0,e[5]=0,e[6]=0,e[7]=0),e[3]=1,e},Je.clone=function(e){var t=new Qe.ARRAY_TYPE(8);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t},Je.fromValues=function(e,t,i,r,n,o,s,a){var l=new Qe.ARRAY_TYPE(8);return l[0]=e,l[1]=t,l[2]=i,l[3]=r,l[4]=n,l[5]=o,l[6]=s,l[7]=a,l},Je.fromRotationTranslationValues=function(e,t,i,r,n,o,s){var a=new Qe.ARRAY_TYPE(8);a[0]=e,a[1]=t,a[2]=i,a[3]=r;var l=.5*n,c=.5*o,h=.5*s;return a[4]=l*r+c*i-h*t,a[5]=c*r+h*e-l*i,a[6]=h*r+l*t-c*e,a[7]=-l*e-c*t-h*i,a},Je.fromRotationTranslation=nt,Je.fromTranslation=function(e,t){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e[4]=.5*t[0],e[5]=.5*t[1],e[6]=.5*t[2],e[7]=0,e},Je.fromRotation=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=0,e[5]=0,e[6]=0,e[7]=0,e},Je.fromMat4=function(e,t){var i=et.create();tt.getRotation(i,t);var r=new Qe.ARRAY_TYPE(3);return tt.getTranslation(r,t),nt(e,i,r),e},Je.copy=ot,Je.identity=function(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e[6]=0,e[7]=0,e},Je.set=function(e,t,i,r,n,o,s,a,l){return e[0]=t,e[1]=i,e[2]=r,e[3]=n,e[4]=o,e[5]=s,e[6]=a,e[7]=l,e},Je.getDual=function(e,t){return e[0]=t[4],e[1]=t[5],e[2]=t[6],e[3]=t[7],e},Je.setDual=function(e,t){return e[4]=t[0],e[5]=t[1],e[6]=t[2],e[7]=t[3],e},Je.getTranslation=function(e,t){var i=t[4],r=t[5],n=t[6],o=t[7],s=-t[0],a=-t[1],l=-t[2],c=t[3];return e[0]=2*(i*c+o*s+r*l-n*a),e[1]=2*(r*c+o*a+n*s-i*l),e[2]=2*(n*c+o*l+i*a-r*s),e},Je.translate=function(e,t,i){var r=t[0],n=t[1],o=t[2],s=t[3],a=.5*i[0],l=.5*i[1],c=.5*i[2],h=t[4],u=t[5],d=t[6],p=t[7];return e[0]=r,e[1]=n,e[2]=o,e[3]=s,e[4]=s*a+n*c-o*l+h,e[5]=s*l+o*a-r*c+u,e[6]=s*c+r*l-n*a+d,e[7]=-r*a-n*l-o*c+p,e},Je.rotateX=function(e,t,i){var r=-t[0],n=-t[1],o=-t[2],s=t[3],a=t[4],l=t[5],c=t[6],h=t[7],u=a*s+h*r+l*o-c*n,d=l*s+h*n+c*r-a*o,p=c*s+h*o+a*n-l*r,f=h*s-a*r-l*n-c*o;return et.rotateX(e,t,i),e[4]=u*(s=e[3])+f*(r=e[0])+d*(o=e[2])-p*(n=e[1]),e[5]=d*s+f*n+p*r-u*o,e[6]=p*s+f*o+u*n-d*r,e[7]=f*s-u*r-d*n-p*o,e},Je.rotateY=function(e,t,i){var r=-t[0],n=-t[1],o=-t[2],s=t[3],a=t[4],l=t[5],c=t[6],h=t[7],u=a*s+h*r+l*o-c*n,d=l*s+h*n+c*r-a*o,p=c*s+h*o+a*n-l*r,f=h*s-a*r-l*n-c*o;return et.rotateY(e,t,i),e[4]=u*(s=e[3])+f*(r=e[0])+d*(o=e[2])-p*(n=e[1]),e[5]=d*s+f*n+p*r-u*o,e[6]=p*s+f*o+u*n-d*r,e[7]=f*s-u*r-d*n-p*o,e},Je.rotateZ=function(e,t,i){var r=-t[0],n=-t[1],o=-t[2],s=t[3],a=t[4],l=t[5],c=t[6],h=t[7],u=a*s+h*r+l*o-c*n,d=l*s+h*n+c*r-a*o,p=c*s+h*o+a*n-l*r,f=h*s-a*r-l*n-c*o;return et.rotateZ(e,t,i),e[4]=u*(s=e[3])+f*(r=e[0])+d*(o=e[2])-p*(n=e[1]),e[5]=d*s+f*n+p*r-u*o,e[6]=p*s+f*o+u*n-d*r,e[7]=f*s-u*r-d*n-p*o,e},Je.rotateByQuatAppend=function(e,t,i){var r=i[0],n=i[1],o=i[2],s=i[3],a=t[0],l=t[1],c=t[2],h=t[3];return e[0]=a*s+h*r+l*o-c*n,e[1]=l*s+h*n+c*r-a*o,e[2]=c*s+h*o+a*n-l*r,e[3]=h*s-a*r-l*n-c*o,e[4]=(a=t[4])*s+(h=t[7])*r+(l=t[5])*o-(c=t[6])*n,e[5]=l*s+h*n+c*r-a*o,e[6]=c*s+h*o+a*n-l*r,e[7]=h*s-a*r-l*n-c*o,e},Je.rotateByQuatPrepend=function(e,t,i){var r=t[0],n=t[1],o=t[2],s=t[3],a=i[0],l=i[1],c=i[2],h=i[3];return e[0]=r*h+s*a+n*c-o*l,e[1]=n*h+s*l+o*a-r*c,e[2]=o*h+s*c+r*l-n*a,e[3]=s*h-r*a-n*l-o*c,e[4]=r*(h=i[7])+s*(a=i[4])+n*(c=i[6])-o*(l=i[5]),e[5]=n*h+s*l+o*a-r*c,e[6]=o*h+s*c+r*l-n*a,e[7]=s*h-r*a-n*l-o*c,e},Je.rotateAroundAxis=function(e,t,i,r){if(Math.abs(r)0){i=Math.sqrt(i);var r=t[0]/i,n=t[1]/i,o=t[2]/i,s=t[3]/i,a=t[4],l=t[5],c=t[6],h=t[7],u=r*a+n*l+o*c+s*h;e[0]=r,e[1]=n,e[2]=o,e[3]=s,e[4]=(a-r*u)/i,e[5]=(l-n*u)/i,e[6]=(c-o*u)/i,e[7]=(h-s*u)/i}return e},Je.str=function(e){return"quat2("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+", "+e[6]+", "+e[7]+")"},Je.exactEquals=function(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]},Je.equals=function(e,t){var i=e[0],r=e[1],n=e[2],o=e[3],s=e[4],a=e[5],l=e[6],c=e[7],h=t[0],u=t[1],d=t[2],p=t[3],f=t[4],m=t[5],_=t[6],g=t[7];return Math.abs(i-h)<=Qe.EPSILON*Math.max(1,Math.abs(i),Math.abs(h))&&Math.abs(r-u)<=Qe.EPSILON*Math.max(1,Math.abs(r),Math.abs(u))&&Math.abs(n-d)<=Qe.EPSILON*Math.max(1,Math.abs(n),Math.abs(d))&&Math.abs(o-p)<=Qe.EPSILON*Math.max(1,Math.abs(o),Math.abs(p))&&Math.abs(s-f)<=Qe.EPSILON*Math.max(1,Math.abs(s),Math.abs(f))&&Math.abs(a-m)<=Qe.EPSILON*Math.max(1,Math.abs(a),Math.abs(m))&&Math.abs(l-_)<=Qe.EPSILON*Math.max(1,Math.abs(l),Math.abs(_))&&Math.abs(c-g)<=Qe.EPSILON*Math.max(1,Math.abs(c),Math.abs(g))},Je.sqrLen=Je.squaredLength=Je.len=Je.length=Je.dot=Je.mul=Je.setReal=Je.getReal=void 0;var Qe=rt(f),et=rt(H),tt=rt(B);function it(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,i=new WeakMap;return(it=function(e){return e?i:t})(e)}function rt(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!==Ke(e)&&"function"!=typeof e)return{default:e};var i=it(t);if(i&&i.has(e))return i.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var s=n?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(r,o,s):r[o]=e[o]}return r.default=e,i&&i.set(e,r),r}function nt(e,t,i){var r=.5*i[0],n=.5*i[1],o=.5*i[2],s=t[0],a=t[1],l=t[2],c=t[3];return e[0]=s,e[1]=a,e[2]=l,e[3]=c,e[4]=r*c+n*l-o*a,e[5]=n*c+o*s-r*l,e[6]=o*c+r*a-n*s,e[7]=-r*s-n*a-o*l,e}function ot(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e}function st(e,t,i){var r=t[0],n=t[1],o=t[2],s=t[3],a=i[4],l=i[5],c=i[6],h=i[7],u=t[4],d=t[5],p=t[6],f=t[7],m=i[0],_=i[1],g=i[2],y=i[3];return e[0]=r*y+s*m+n*g-o*_,e[1]=n*y+s*_+o*m-r*g,e[2]=o*y+s*g+r*_-n*m,e[3]=s*y-r*m-n*_-o*g,e[4]=r*h+s*a+n*c-o*l+u*y+f*m+d*g-p*_,e[5]=n*h+s*l+o*a-r*c+d*y+f*_+p*m-u*g,e[6]=o*h+s*c+r*l-n*a+p*y+f*g+u*_-d*m,e[7]=s*h-r*a-n*l-o*c+f*y-u*m-d*_-p*g,e}Je.getReal=et.copy,Je.setReal=et.copy,Je.mul=st;var at=et.dot;Je.dot=at;var lt=et.length;Je.length=lt,Je.len=lt;var ct=et.squaredLength;Je.squaredLength=ct,Je.sqrLen=ct;var ht={};function ut(e){return ut="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ut(e)}Object.defineProperty(ht,"__esModule",{value:!0}),ht.create=ft,ht.clone=function(e){var t=new dt.ARRAY_TYPE(2);return t[0]=e[0],t[1]=e[1],t},ht.fromValues=function(e,t){var i=new dt.ARRAY_TYPE(2);return i[0]=e,i[1]=t,i},ht.copy=function(e,t){return e[0]=t[0],e[1]=t[1],e},ht.set=function(e,t,i){return e[0]=t,e[1]=i,e},ht.add=function(e,t,i){return e[0]=t[0]+i[0],e[1]=t[1]+i[1],e},ht.subtract=mt,ht.multiply=_t,ht.divide=gt,ht.ceil=function(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e},ht.floor=function(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e},ht.min=function(e,t,i){return e[0]=Math.min(t[0],i[0]),e[1]=Math.min(t[1],i[1]),e},ht.max=function(e,t,i){return e[0]=Math.max(t[0],i[0]),e[1]=Math.max(t[1],i[1]),e},ht.round=function(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e},ht.scale=function(e,t,i){return e[0]=t[0]*i,e[1]=t[1]*i,e},ht.scaleAndAdd=function(e,t,i,r){return e[0]=t[0]+i[0]*r,e[1]=t[1]+i[1]*r,e},ht.distance=yt,ht.squaredDistance=xt,ht.length=vt,ht.squaredLength=bt,ht.negate=function(e,t){return e[0]=-t[0],e[1]=-t[1],e},ht.inverse=function(e,t){return e[0]=1/t[0],e[1]=1/t[1],e},ht.normalize=function(e,t){var i=t[0],r=t[1],n=i*i+r*r;return n>0&&(n=1/Math.sqrt(n)),e[0]=t[0]*n,e[1]=t[1]*n,e},ht.dot=function(e,t){return e[0]*t[0]+e[1]*t[1]},ht.cross=function(e,t,i){var r=t[0]*i[1]-t[1]*i[0];return e[0]=e[1]=0,e[2]=r,e},ht.lerp=function(e,t,i,r){var n=t[0],o=t[1];return e[0]=n+r*(i[0]-n),e[1]=o+r*(i[1]-o),e},ht.random=function(e,t){t=t||1;var i=2*dt.RANDOM()*Math.PI;return e[0]=Math.cos(i)*t,e[1]=Math.sin(i)*t,e},ht.transformMat2=function(e,t,i){var r=t[0],n=t[1];return e[0]=i[0]*r+i[2]*n,e[1]=i[1]*r+i[3]*n,e},ht.transformMat2d=function(e,t,i){var r=t[0],n=t[1];return e[0]=i[0]*r+i[2]*n+i[4],e[1]=i[1]*r+i[3]*n+i[5],e},ht.transformMat3=function(e,t,i){var r=t[0],n=t[1];return e[0]=i[0]*r+i[3]*n+i[6],e[1]=i[1]*r+i[4]*n+i[7],e},ht.transformMat4=function(e,t,i){var r=t[0],n=t[1];return e[0]=i[0]*r+i[4]*n+i[12],e[1]=i[1]*r+i[5]*n+i[13],e},ht.rotate=function(e,t,i,r){var n=t[0]-i[0],o=t[1]-i[1],s=Math.sin(r),a=Math.cos(r);return e[0]=n*a-o*s+i[0],e[1]=n*s+o*a+i[1],e},ht.angle=function(e,t){var i=e[0],r=e[1],n=t[0],o=t[1],s=Math.sqrt(i*i+r*r)*Math.sqrt(n*n+o*o);return Math.acos(Math.min(Math.max(s&&(i*n+r*o)/s,-1),1))},ht.zero=function(e){return e[0]=0,e[1]=0,e},ht.str=function(e){return"vec2("+e[0]+", "+e[1]+")"},ht.exactEquals=function(e,t){return e[0]===t[0]&&e[1]===t[1]},ht.equals=function(e,t){var i=e[0],r=e[1],n=t[0],o=t[1];return Math.abs(i-n)<=dt.EPSILON*Math.max(1,Math.abs(i),Math.abs(n))&&Math.abs(r-o)<=dt.EPSILON*Math.max(1,Math.abs(r),Math.abs(o))},ht.forEach=ht.sqrLen=ht.sqrDist=ht.dist=ht.div=ht.mul=ht.sub=ht.len=void 0;var dt=(function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==ut(e)&&"function"!=typeof e)return{default:e};var t=pt(void 0);if(t&&t.has(e))return t.get(e);var i={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if("default"!==n&&Object.prototype.hasOwnProperty.call(e,n)){var o=r?Object.getOwnPropertyDescriptor(e,n):null;o&&(o.get||o.set)?Object.defineProperty(i,n,o):i[n]=e[n]}return i.default=e,t&&t.set(e,i),i})(f);function pt(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,i=new WeakMap;return(pt=function(e){return e?i:t})(e)}function ft(){var e=new dt.ARRAY_TYPE(2);return dt.ARRAY_TYPE!=Float32Array&&(e[0]=0,e[1]=0),e}function mt(e,t,i){return e[0]=t[0]-i[0],e[1]=t[1]-i[1],e}function _t(e,t,i){return e[0]=t[0]*i[0],e[1]=t[1]*i[1],e}function gt(e,t,i){return e[0]=t[0]/i[0],e[1]=t[1]/i[1],e}function yt(e,t){return Math.hypot(t[0]-e[0],t[1]-e[1])}function xt(e,t){var i=t[0]-e[0],r=t[1]-e[1];return i*i+r*r}function vt(e){return Math.hypot(e[0],e[1])}function bt(e){var t=e[0],i=e[1];return t*t+i*i}ht.len=vt,ht.sub=mt,ht.mul=_t,ht.div=gt,ht.dist=yt,ht.sqrDist=xt,ht.sqrLen=bt;var wt=(function(){var e=ft();return function(t,i,r,n,o,s){var a,l;for(i||(i=2),r||(r=0),l=n?Math.min(n*i+r,t.length):t.length,a=r;a1)return 1;for(var i=e,r=0;r<8;r++){var n=this.sampleCurveX(i)-e;if(Math.abs(n)n?s=i:a=i,i=.5*(a-s)+s;return i},solve:function(e,t){return this.sampleCurveY(this.solveCurveX(e,t))}};var Ft=d(Ot),Nt=Vt;function Vt(e,t){this.x=e,this.y=t}Vt.prototype={clone:function(){return new Vt(this.x,this.y)},add:function(e){return this.clone()._add(e)},sub:function(e){return this.clone()._sub(e)},multByPoint:function(e){return this.clone()._multByPoint(e)},divByPoint:function(e){return this.clone()._divByPoint(e)},mult:function(e){return this.clone()._mult(e)},div:function(e){return this.clone()._div(e)},rotate:function(e){return this.clone()._rotate(e)},rotateAround:function(e,t){return this.clone()._rotateAround(e,t)},matMult:function(e){return this.clone()._matMult(e)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(e){return this.x===e.x&&this.y===e.y},dist:function(e){return Math.sqrt(this.distSqr(e))},distSqr:function(e){var t=e.x-this.x,i=e.y-this.y;return t*t+i*i},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(e){return Math.atan2(this.y-e.y,this.x-e.x)},angleWith:function(e){return this.angleWithSep(e.x,e.y)},angleWithSep:function(e,t){return Math.atan2(this.x*t-this.y*e,this.x*e+this.y*t)},_matMult:function(e){var t=e[2]*this.x+e[3]*this.y;return this.x=e[0]*this.x+e[1]*this.y,this.y=t,this},_add:function(e){return this.x+=e.x,this.y+=e.y,this},_sub:function(e){return this.x-=e.x,this.y-=e.y,this},_mult:function(e){return this.x*=e,this.y*=e,this},_div:function(e){return this.x/=e,this.y/=e,this},_multByPoint:function(e){return this.x*=e.x,this.y*=e.y,this},_divByPoint:function(e){return this.x/=e.x,this.y/=e.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var e=this.y;return this.y=this.x,this.x=-e,this},_rotate:function(e){var t=Math.cos(e),i=Math.sin(e),r=i*this.x+t*this.y;return this.x=t*this.x-i*this.y,this.y=r,this},_rotateAround:function(e,t){var i=Math.cos(e),r=Math.sin(e),n=t.y+r*(this.x-t.x)+i*(this.y-t.y);return this.x=t.x+i*(this.x-t.x)-r*(this.y-t.y),this.y=n,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},Vt.convert=function(e){return e instanceof Vt?e:Array.isArray(e)?new Vt(e[0],e[1]):e};var Ut=d(Nt);function jt(e,t){if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(let i=0;i=1)return 1;const t=e*e,i=t*e;return 4*(e<.5?i:3*(e-t)+i-.75)}function Xt(e,t,i,r){const n=new Ft(e,t,i,r);return function(e){return n.solve(e)}}const Yt=Xt(.25,.1,.25,1);function Jt(e,t,i){return Math.min(i,Math.max(t,e))}function Kt(e,t,i){return(i=Jt((i-e)/(t-e),0,1))*i*(3-2*i)}function Qt(e,t,i){const r=i-t,n=((e-t)%r+r)%r+t;return n===t?i:n}function ei(e,t,i){if(!e.length)return i(null,[]);let r=e.length;const n=new Array(e.length);let o=null;e.forEach(((e,s)=>{t(e,((e,t)=>{e&&(o=e),n[s]=t,0==--r&&i(o,n)}))}))}function ti(e){const t=[];for(const i in e)t.push(e[i]);return t}function ii(e,...t){for(const i of t)for(const t in i)e[t]=i[t];return e}let ri=1;function ni(){return ri++}function oi(){return(function e(t){return t?(t^Math.random()*(16>>t/4)).toString(16):"10000000-1000-4000-8000-100000000000".replace(/[018]/g,e)})()}function si(e){return e<=1?1:Math.pow(2,Math.ceil(Math.log(e)/Math.LN2))}function ai(e){return!!e&&/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(e)}function li(e,t){e.forEach((e=>{t[e]&&(t[e]=t[e].bind(t))}))}function ci(e,t){return-1!==e.indexOf(t,e.length-t.length)}function hi(e,t,i){const r={};for(const i in e)r[i]=t.call(this,e[i],i,e);return r}function ui(e,t,i){const r={};for(const i in e)t.call(this,e[i],i,e)&&(r[i]=e[i]);return r}function di(e){return Array.isArray(e)?e.map(di):"object"==typeof e&&e?hi(e,di):e}const pi={};function fi(e){pi[e]||("undefined"!=typeof console&&console.warn(e),pi[e]=!0)}function mi(e,t,i){return(i.y-e.y)*(t.x-e.x)>(t.y-e.y)*(i.x-e.x)}function _i(e){let t=0;for(let i,r,n=0,o=e.length,s=o-1;n@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,((e,i,r,n)=>{const o=r||n;return t[i]=!o||o.toLowerCase(),""})),t["max-age"]){const e=parseInt(t["max-age"],10);isNaN(e)?delete t["max-age"]:t["max-age"]=e}return t}let vi,bi,wi,Ti,Ei,Si,Mi=null;function Ai(e){try{const t=self[e];return t.setItem("_mapbox_test_",1),t.removeItem("_mapbox_test_"),!0}catch(e){return!1}}function Ii(e,t){return[e[4*t],e[4*t+1],e[4*t+2],e[4*t+3]]}function Ci(e,t,i,r){for(;t>1;e[n]>1;e[n]<=r?t=n+1:i=n}return t}function zi(e){return e>0?1/(1.001-e):1+e}function Di(e){return e>0?1-1/(1.001-e):-e}function Ri(){return null==vi&&(vi=self.OffscreenCanvas&&new OffscreenCanvas(1,1).getContext("2d")&&"function"==typeof self.createImageBitmap),vi}const Li={now:()=>void 0!==Ti?Ti:performance.now(),setNow(e){Ti=e},restoreNow(){Ti=void 0},frame(e){const t=requestAnimationFrame(e);return{cancel:()=>cancelAnimationFrame(t)}},getImageData(e,t=0){const{width:i,height:r}=e;Ei||(Ei=document.createElement("canvas"));const n=Ei.getContext("2d",{willReadFrequently:!0});if(!n)throw new Error("failed to create canvas 2d context");return(i>Ei.width||r>Ei.height)&&(Ei.width=i,Ei.height=r),n.clearRect(-t,-t,i+2*t,r+2*t),n.drawImage(e,0,0,i,r),n.getImageData(-t,-t,i+2*t,r+2*t)},resolveURL:e=>(bi||(bi=document.createElement("a")),bi.href=e,bi.href),get devicePixelRatio(){return window.devicePixelRatio},get prefersReducedMotion(){return!!window.matchMedia&&(null==wi&&(wi=window.matchMedia("(prefers-reduced-motion: reduce)")),wi.matches)},hasCanvasFingerprintNoise(){if(void 0!==Si)return Si;if(!Ri())return Si=!1,!1;const e=new OffscreenCanvas(85,1),t=e.getContext("2d",{willReadFrequently:!0});let i=0;for(let r=0;r0?`?${o}`:""}`}const Bi="mapbox-tiles";let Fi=500,Ni=50;const Vi=["language","worldview","jobid"];let Ui,ji;function $i(){try{return caches}catch(e){}}function Gi(){const e=$i();e&&!Ui&&(Ui=e.open(Bi))}let qi=1/0;const Zi={supported:!1,testSupport:function(e){!Xi&&Hi&&(Yi?Ki(e):Wi=e)}};let Wi,Hi,Xi=!1,Yi=!1;const Ji="undefined"!=typeof self?self:{};function Ki(e){const t=e.createTexture();e.bindTexture(e.TEXTURE_2D,t);try{if(e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,Hi),e.isContextLost())return;Zi.supported=!0}catch(e){}e.deleteTexture(t),Xi=!0}Ji.document&&(Hi=Ji.document.createElement("img"),Hi.onload=function(){Wi&&Ki(Wi),Wi=null,Yi=!0},Hi.onerror=function(){Xi=!0,Wi=null},Hi.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");const Qi={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image",Model:"Model"};"function"==typeof Object.freeze&&Object.freeze(Qi);class er extends Error{constructor(e,t,i){401===t&&n(i)&&(e+=": you may have provided an invalid Mapbox access token. See https://docs.mapbox.com/api/overview/#access-tokens-and-token-scopes"),super(e),this.status=t,this.url=i}toString(){return`${this.name}: ${this.message} (${this.status}): ${this.url}`}}const tr=yi()?()=>self.worker&&self.worker.referrer:()=>("blob:"===location.protocol?parent:self).location.href,ir=function(e,t){if(!(/^file:/.test(i=e.url)||/^file:/.test(tr())&&!/^\w+:/.test(i))){if(self.fetch&&self.Request&&self.AbortController&&Request.prototype.hasOwnProperty("signal"))return(function(e,t){const i=new AbortController,r=new Request(e.url,{method:e.method||"GET",body:e.body,credentials:e.credentials,headers:e.headers,referrer:tr(),referrerPolicy:e.referrerPolicy,signal:i.signal});let o=!1,s=!1;const a=(l=r.url).indexOf("sku=")>0&&n(l);var l;"json"===e.type&&r.headers.set("Accept","application/json");const c=(i,n,o)=>{if(s)return;if(i&&"SecurityError"!==i.message&&fi(i.toString()),n&&o)return h(n);const l=Date.now();fetch(r).then((i=>{if(i.ok){const e=a?i.clone():null;return h(i,e,l)}return t(new er(i.statusText,i.status,e.url))})).catch((i=>{"AbortError"!==i.name&&t(new Error(`${i.message} ${e.url}`))}))},h=(i,n,a)=>{("arrayBuffer"===e.type?i.arrayBuffer():"json"===e.type?i.json():i.text()).then((e=>{s||(n&&a&&(function(e,t,i){if(Gi(),!Ui)return;const r=xi(t.headers.get("Cache-Control")||"");if(r["no-store"])return;const n={status:t.status,statusText:t.statusText,headers:new Headers};t.headers.forEach(((e,t)=>n.headers.set(t,e))),r["max-age"]&&n.headers.set("Expires",new Date(i+1e3*r["max-age"]).toUTCString());const o=n.headers.get("Expires");if(!o)return;if(new Date(o).getTime()-i<42e4)return;let s=Oi(e.url,{persistentParams:Vi});if(206===t.status){const t=e.headers.get("Range");if(!t)return;n.status=200,s=ki(s,{range:t})}!(function(e,t){if(void 0===ji)try{new Response(new ReadableStream),ji=!0}catch(e){ji=!1}ji?t(e.body):e.blob().then(t)})(t,(e=>{const i=new Response(200!==(r=t.status)&&404!==r&&[101,103,204,205,304].includes(r)?null:e,n);var r;Gi(),Ui&&Ui.then((e=>e.put(s,i))).catch((e=>fi(e.message)))}))})(r,n,a),o=!0,t(null,e,i.headers.get("Cache-Control"),i.headers.get("Expires")))})).catch((e=>{s||t(new Error(e.message))}))};return a?(function(e,t){if(Gi(),!Ui)return t(null);Ui.then((i=>{let r=Oi(e.url,{persistentParams:Vi});const n=e.headers.get("Range");n&&(r=ki(r,{range:n})),i.match(r).then((e=>{const n=(function(e){if(!e)return!1;const t=new Date(e.headers.get("Expires")||0),i=xi(e.headers.get("Cache-Control")||"");return t>Date.now()&&!i["no-cache"]})(e);i.delete(r),n&&i.put(r,e.clone()),t(null,e,n)})).catch(t)})).catch(t)})(r,c):c(null,null),{cancel:()=>{s=!0,o||i.abort()}}})(e,t);if(yi()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",e,t,void 0,!0)}var i;return(function(e,t){const i=new XMLHttpRequest;i.open(e.method||"GET",e.url,!0),"arrayBuffer"===e.type&&(i.responseType="arraybuffer");for(const t in e.headers)i.setRequestHeader(t,e.headers[t]);return"json"===e.type&&(i.responseType="text",i.setRequestHeader("Accept","application/json")),i.withCredentials="include"===e.credentials,i.onerror=()=>{t(new Error(i.statusText))},i.onload=()=>{if((i.status>=200&&i.status<300||0===i.status)&&null!==i.response){let r=i.response;if("json"===e.type)try{r=JSON.parse(i.response)}catch(e){return t(e)}t(null,r,i.getResponseHeader("Cache-Control"),i.getResponseHeader("Expires"))}else t(new er(i.statusText,i.status,e.url))},i.send(e.body),{cancel:()=>i.abort()}})(e,t)},rr=function(e,t){return ir(ii(e,{type:"arrayBuffer"}),t)};function nr(e){const t=document.createElement("a");return t.href=e,t.protocol===location.protocol&&t.host===location.host}const or="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";let sr,ar;sr=[],ar=0;const lr=function(e,t){if(Zi.supported&&(e.headers||(e.headers={}),e.headers.accept="image/webp,*/*"),ar>=r.MAX_PARALLEL_IMAGE_REQUESTS){const i={requestParameters:e,callback:t,cancelled:!1,cancel(){this.cancelled=!0}};return sr.push(i),i}ar++;let i=!1;const n=()=>{if(!i)for(i=!0,ar--;sr.length&&ar{n(),e?t(e):i&&(self.createImageBitmap?(function(e,t){const i=new Blob([new Uint8Array(e)],{type:"image/png"});createImageBitmap(i).then((e=>{t(null,e)})).catch((e=>{t(new Error(`Could not load image because of ${e.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`))}))})(i,((e,i)=>t(e,i,r,o))):(function(e,t){const i=new Image;i.onload=()=>{t(null,i),URL.revokeObjectURL(i.src),i.onload=null,requestAnimationFrame((()=>{i.src=or}))},i.onerror=()=>t(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 r=new Blob([new Uint8Array(e)],{type:"image/png"});i.src=e.byteLength?URL.createObjectURL(r):or})(i,((e,i)=>t(e,i,r,o))))}));return{cancel:()=>{o.cancel(),n()}}},cr="01",hr="NO_ACCESS_TOKEN",ur=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function dr(e){const t=e.match(ur);if(!t)throw new Error("Unable to parse URL object");return{protocol:t[1],authority:t[2],path:t[3]||"/",params:t[4]?t[4].split("&"):[]}}function pr(e){const t=e.params.length?`?${e.params.join("&")}`:"";return`${e.protocol}://${e.authority}${e.path}${t}`}const fr="mapbox.eventData";function mr(e){if(!e)return null;const t=e.split(".");if(!t||3!==t.length)return null;try{return JSON.parse(decodeURIComponent(atob(t[1]).split("").map((e=>"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2))).join("")))}catch(e){return null}}class _r{constructor(e){this.type=e,this.anonId=null,this.eventData={},this.queue=[],this.pendingRequest=null}getStorageKey(e){const t=mr(r.ACCESS_TOKEN);let i="";return i=t&&t.u?btoa(encodeURIComponent(t.u).replace(/%([0-9A-F]{2})/g,((e,t)=>String.fromCharCode(Number("0x"+t))))):r.ACCESS_TOKEN||"",e?`${fr}.${e}:${i}`:`${fr}:${i}`}fetchEventData(){const e=Ai("localStorage"),t=this.getStorageKey(),i=this.getStorageKey("uuid");if(e)try{const e=localStorage.getItem(t);e&&(this.eventData=JSON.parse(e));const r=localStorage.getItem(i);r&&(this.anonId=r)}catch(e){fi("Unable to read from LocalStorage")}}saveEventData(){const e=Ai("localStorage"),t=this.getStorageKey(),i=this.getStorageKey("uuid"),r=this.anonId;if(e&&r)try{localStorage.setItem(i,r),Object.keys(this.eventData).length>=1&&localStorage.setItem(t,JSON.stringify(this.eventData))}catch(e){fi("Unable to write to LocalStorage")}}processRequests(e){}postEvent(e,t,i,n){if(!r.EVENTS_URL)return;const o=dr(r.EVENTS_URL);o.params.push(`access_token=${n||r.ACCESS_TOKEN||""}`);const s={event:this.type,created:new Date(e).toISOString()},a=t?ii(s,t):s,l={url:pr(o),headers:{"Content-Type":"text/plain"},body:JSON.stringify([a])};this.pendingRequest=(function(e,t){return ir(ii(e,{method:"POST"}),t)})(l,(e=>{this.pendingRequest=null,i(e),this.saveEventData(),this.processRequests(n)}))}queueRequest(e,t){this.queue.push(e),this.processRequests(t)}}const gr=new class extends _r{constructor(e){super("appUserTurnstile"),this._customAccessToken=e}postTurnstileEvent(e,t){r.EVENTS_URL&&r.ACCESS_TOKEN&&Array.isArray(e)&&e.some((e=>o(e)||n(e)))&&this.queueRequest(Date.now(),t)}processRequests(e){if(this.pendingRequest||0===this.queue.length)return;this.anonId&&this.eventData.lastSuccess&&this.eventData.tokenU||this.fetchEventData();const i=mr(r.ACCESS_TOKEN),n=i?i.u:r.ACCESS_TOKEN;let o=n!==this.eventData.tokenU;ai(this.anonId)||(this.anonId=oi(),o=!0);const s=this.queue.shift();if(this.eventData.lastSuccess){const e=new Date(this.eventData.lastSuccess),t=new Date(s),i=(s-this.eventData.lastSuccess)/864e5;o=o||i>=1||i<-1||e.getDate()!==t.getDate()}else o=!0;o?this.postEvent(s,{sdkIdentifier:"mapbox-gl-js",sdkVersion:t,skuId:cr,"enabled.telemetry":!1,userId:this.anonId},(e=>{e||(this.eventData.lastSuccess=s,this.eventData.tokenU=n)}),e):this.processRequests()}},yr=gr.postTurnstileEvent.bind(gr),xr=new class extends _r{constructor(){super("map.load"),this.success={},this.skuToken=""}postMapLoadEvent(e,t,i,n){this.skuToken=t,this.errorCb=n,r.EVENTS_URL&&(i||r.ACCESS_TOKEN?this.queueRequest({id:e,timestamp:Date.now()},i):this.errorCb(new Error(hr)))}processRequests(e){if(this.pendingRequest||0===this.queue.length)return;const{id:i,timestamp:r}=this.queue.shift();i&&this.success[i]||(this.anonId||this.fetchEventData(),ai(this.anonId)||(this.anonId=oi()),this.postEvent(r,{sdkIdentifier:"mapbox-gl-js",sdkVersion:t,skuId:cr,skuToken:this.skuToken,userId:this.anonId},(e=>{e?this.errorCb(e):i&&(this.success[i]=!0)}),e))}remove(){this.errorCb=null}},vr=xr.postMapLoadEvent.bind(xr),br=new class extends _r{constructor(){super("style.load"),this.eventIdPerMapInstanceMap=new Map,this.mapInstanceIdMap=new WeakMap}getMapInstanceId(e){let t=this.mapInstanceIdMap.get(e);return t||(t=oi(),this.mapInstanceIdMap.set(e,t)),t}getEventId(e){const t=this.eventIdPerMapInstanceMap.get(e)||0;return this.eventIdPerMapInstanceMap.set(e,t+1),t}postStyleLoadEvent(e,t){const{map:i,style:n,importedStyles:o}=t;if(!r.EVENTS_URL||!e&&!r.ACCESS_TOKEN)return;const s=this.getMapInstanceId(i),a={mapInstanceId:s,eventId:this.getEventId(s),style:n};o.length&&(a.importedStyles=o),this.queueRequest({timestamp:Date.now(),payload:a},e)}processRequests(e){if(this.pendingRequest||0===this.queue.length)return;const{timestamp:t,payload:i}=this.queue.shift();this.postEvent(t,i,(()=>{}),e)}},wr=br.postStyleLoadEvent.bind(br),Tr=new class extends _r{constructor(){super("gljs.performance")}postPerformanceEvent(e,t){r.EVENTS_URL&&(e||r.ACCESS_TOKEN)&&this.queueRequest({timestamp:Date.now(),performanceData:t},e)}processRequests(e){if(this.pendingRequest||0===this.queue.length)return;const{timestamp:i,performanceData:r}=this.queue.shift(),n=(function(e){const i=performance.getEntriesByType("resource"),r=performance.getEntriesByType("mark"),n=(function(e){const t={};if(e)for(const i in e)if("other"!==i)for(const r of e[i]){const e=`${i}ResolveRangeMin`,n=`${i}ResolveRangeMax`,o=`${i}RequestCount`,s=`${i}RequestCachedCount`;t[e]=Math.min(t[e]||1/0,r.startTime),t[n]=Math.max(t[n]||-1/0,r.responseEnd);const a=e=>{void 0===t[e]&&(t[e]=0),++t[e]};void 0!==r.transferSize&&0===r.transferSize&&a(s),a(o)}return t})((function(e,t){const i={};if(e)for(const r of e){const e=t(r);void 0===i[e]&&(i[e]=[]),i[e].push(r)}return i})(i,u)),o=window.devicePixelRatio,s=navigator.connection||navigator.mozConnection||navigator.webkitConnection,a=s?s.effectiveType:void 0,h={counters:[],metadata:[],attributes:[]},d=(e,t,i)=>{null!=i&&e.push({name:t,value:i.toString()})};for(const e in n)d(h.counters,e,n[e]);if(e.interactionRange[0]!==1/0&&e.interactionRange[1]!==-1/0&&(d(h.counters,"interactionRangeMin",e.interactionRange[0]),d(h.counters,"interactionRangeMax",e.interactionRange[1])),r)for(const e of Object.keys(c)){const t=c[e],i=r.find((e=>e.name===t));i&&d(h.counters,t,i.startTime)}return d(h.counters,"visibilityHidden",e.visibilityHidden),d(h.attributes,"style",(function(e){if(e)for(const t of e){const e=t.name.split("?")[0];if(l(e)){const t=e.split("/").slice(-2);if(2===t.length)return`mapbox://styles/${t[0]}/${t[1]}`}}})(i)),d(h.attributes,"terrainEnabled",e.terrainEnabled?"true":"false"),d(h.attributes,"fogEnabled",e.fogEnabled?"true":"false"),d(h.attributes,"projection",e.projection),d(h.attributes,"zoom",e.zoom),d(h.metadata,"devicePixelRatio",o),d(h.metadata,"connectionEffectiveType",a),d(h.metadata,"navigatorUserAgent",navigator.userAgent),d(h.metadata,"screenWidth",window.screen.width),d(h.metadata,"screenHeight",window.screen.height),d(h.metadata,"windowWidth",window.innerWidth),d(h.metadata,"windowHeight",window.innerHeight),d(h.metadata,"mapWidth",e.width/o),d(h.metadata,"mapHeight",e.height/o),d(h.metadata,"webglRenderer",e.renderer),d(h.metadata,"webglVendor",e.vendor),d(h.metadata,"sdkVersion",t),d(h.metadata,"sdkIdentifier","mapbox-gl-js"),h})(r);for(const e of n.metadata);for(const e of n.counters);for(const e of n.attributes);this.postEvent(i,n,(()=>{}),e)}},Er=Tr.postPerformanceEvent.bind(Tr),Sr=new class extends _r{constructor(){super("map.auth"),this.success={},this.skuToken=""}getSession(e,t,i,n){if(!r.API_URL||!r.SESSION_PATH)return;const o=dr(r.API_URL+r.SESSION_PATH);o.params.push(`sku=${t||""}`),o.params.push(`access_token=${n||r.ACCESS_TOKEN||""}`);const s={url:pr(o),headers:{"Content-Type":"text/plain"}};this.pendingRequest=(function(e,t){return ir(ii(e,{method:"GET"}),t)})(s,(e=>{this.pendingRequest=null,i(e),this.saveEventData(),this.processRequests(n)}))}getSessionAPI(e,t,i,n){this.skuToken=t,this.errorCb=n,r.SESSION_PATH&&r.API_URL&&(i||r.ACCESS_TOKEN?this.queueRequest({id:e,timestamp:Date.now()},i):this.errorCb(new Error(hr)))}processRequests(e){if(this.pendingRequest||0===this.queue.length)return;const{id:t,timestamp:i}=this.queue.shift();t&&this.success[t]||this.getSession(i,this.skuToken,(e=>{e?this.errorCb(e):t&&(this.success[t]=!0)}),e)}remove(){this.errorCb=null}},Mr=Sr.getSessionAPI.bind(Sr),Ar=new Set;var Ir={exports:{}},Cr={exports:function(e,t){for(var i,r=e.length,n=t^r,o=0;r>=4;)i=1540483477*(65535&(i=255&e.charCodeAt(o)|(255&e.charCodeAt(++o))<<8|(255&e.charCodeAt(++o))<<16|(255&e.charCodeAt(++o))<<24))+((1540483477*(i>>>16)&65535)<<16),n=1540483477*(65535&n)+((1540483477*(n>>>16)&65535)<<16)^(i=1540483477*(65535&(i^=i>>>24))+((1540483477*(i>>>16)&65535)<<16)),r-=4,++o;switch(r){case 3:n^=(255&e.charCodeAt(o+2))<<16;case 2:n^=(255&e.charCodeAt(o+1))<<8;case 1:n=1540483477*(65535&(n^=255&e.charCodeAt(o)))+((1540483477*(n>>>16)&65535)<<16)}return n=1540483477*(65535&(n^=n>>>13))+((1540483477*(n>>>16)&65535)<<16),(n^=n>>>15)>>>0}},Pr=function(e,t){var i,r,n,o,s,a,l,c;for(r=e.length-(i=3&e.length),n=t,s=3432918353,a=461845907,c=0;c>>16)*s&65535)<<16)&4294967295)<<15|l>>>17))*a+(((l>>>16)*a&65535)<<16)&4294967295)<<13|n>>>19))+((5*(n>>>16)&65535)<<16)&4294967295))+((58964+(o>>>16)&65535)<<16);switch(l=0,i){case 3:l^=(255&e.charCodeAt(c+2))<<16;case 2:l^=(255&e.charCodeAt(c+1))<<8;case 1:n^=l=(65535&(l=(l=(65535&(l^=255&e.charCodeAt(c)))*s+(((l>>>16)*s&65535)<<16)&4294967295)<<15|l>>>17))*a+(((l>>>16)*a&65535)<<16)&4294967295}return n^=e.length,n=2246822507*(65535&(n^=n>>>16))+((2246822507*(n>>>16)&65535)<<16)&4294967295,n=3266489909*(65535&(n^=n>>>13))+((3266489909*(n>>>16)&65535)<<16)&4294967295,(n^=n>>>16)>>>0},zr=Cr.exports;Ir.exports=Pr,Ir.exports.murmur3=Pr,Ir.exports.murmur2=zr;var Dr=d(Ir.exports);class Rr{constructor(e,...t){ii(this,t[0]||{}),this.type=e}}class Lr extends Rr{constructor(e,t={}){super("error",ii({error:e},t))}}function kr(e,t,i){i[e]&&-1!==i[e].indexOf(t)||(i[e]=i[e]||[],i[e].push(t))}function Or(e,t,i){if(i&&i[e]){const r=i[e].indexOf(t);-1!==r&&i[e].splice(r,1)}}class Br{on(e,t){return this._listeners=this._listeners||{},kr(e,t,this._listeners),this}off(e,t){return Or(e,t,this._listeners),Or(e,t,this._oneTimeListeners),this}once(e,t){return t?(this._oneTimeListeners=this._oneTimeListeners||{},kr(e,t,this._oneTimeListeners),this):new Promise((t=>this.once(e,t)))}fire(e,t){const i="string"==typeof e?new Rr(e,t):e,r=i.type;if(this.listens(r)){i.target=this;const e=this._listeners&&this._listeners[r]?this._listeners[r].slice():[];for(const t of e)t.call(this,i);const t=this._oneTimeListeners&&this._oneTimeListeners[r]?this._oneTimeListeners[r].slice():[];for(const e of t)Or(r,e,this._oneTimeListeners),e.call(this,i);const n=this._eventedParent;n&&(ii(i,"function"==typeof this._eventedParentData?this._eventedParentData():this._eventedParentData),n.fire(i))}else i instanceof Lr&&console.error(i.error);return this}listens(e){return!!(this._listeners&&this._listeners[e]&&this._listeners[e].length>0||this._oneTimeListeners&&this._oneTimeListeners[e]&&this._oneTimeListeners[e].length>0||this._eventedParent&&this._eventedParent.listens(e))}setEventedParent(e,t){return this._eventedParent=e,this._eventedParentData=t,this}}e.G=void 0;var Fr={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],rebeccapurple:[102,51,153,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function Nr(e){return(e=Math.round(e))<0?0:e>255?255:e}function Vr(e){return Nr("%"===e[e.length-1]?parseFloat(e)/100*255:parseInt(e))}function Ur(e){return(t="%"===e[e.length-1]?parseFloat(e)/100:parseFloat(e))<0?0:t>1?1:t;var t}function jr(e,t,i){return i<0?i+=1:i>1&&(i-=1),6*i<1?e+(t-e)*i*6:2*i<1?t:3*i<2?e+(t-e)*(.6666666666666666-i)*6:e}try{e.G={}.parseCSSColor=function(e){var t,i=e.replace(/ /g,"").toLowerCase();if(i in Fr)return Fr[i].slice();if("#"===i[0])return 4===i.length?(t=parseInt(i.substr(1),16))>=0&&t<=4095?[(3840&t)>>4|(3840&t)>>8,240&t|(240&t)>>4,15&t|(15&t)<<4,1]:null:7===i.length&&(t=parseInt(i.substr(1),16))>=0&&t<=16777215?[(16711680&t)>>16,(65280&t)>>8,255&t,1]:null;var r=i.indexOf("("),n=i.indexOf(")");if(-1!==r&&n+1===i.length){var o=i.substr(0,r),s=i.substr(r+1,n-(r+1)).split(","),a=1;switch(o){case"rgba":if(4!==s.length)return null;a=Ur(s.pop());case"rgb":return 3!==s.length?null:[Vr(s[0]),Vr(s[1]),Vr(s[2]),a];case"hsla":if(4!==s.length)return null;a=Ur(s.pop());case"hsl":if(3!==s.length)return null;var l=(parseFloat(s[0])%360+360)%360/360,c=Ur(s[1]),h=Ur(s[2]),u=h<=.5?h*(c+1):h+c-h*c,d=2*h-u;return[Nr(255*jr(d,u,l+.3333333333333333)),Nr(255*jr(d,u,l)),Nr(255*jr(d,u,l-.3333333333333333)),a];default:return null}}return null}}catch(e){}class $r{constructor(e,t,i,r=1){this.r=e,this.g=t,this.b=i,this.a=r}static parse(t){if(!t)return;if(t instanceof $r)return t;if("string"!=typeof t)return;const i=e.G(t);return i?new $r(i[0]/255*i[3],i[1]/255*i[3],i[2]/255*i[3],i[3]):void 0}toString(){const[e,t,i,r]=0===this.a?[0,0,0,0]:[255*this.r/this.a,255*this.g/this.a,255*this.b/this.a,this.a];return`rgba(${Math.round(e)},${Math.round(t)},${Math.round(i)},${r})`}toRenderColor(e){const{r:t,g:i,b:r,a:n}=this;return new Gr(e,t,i,r,n)}}class Gr{constructor(e,t,i,r,n){if(e){const o=e.image.height,s=o*o;t=0===n?0:t/n*(o-1),i=0===n?0:i/n*(o-1),r=0===n?0:r/n*(o-1);const a=Math.floor(t),l=Math.floor(i),c=Math.floor(r),h=Math.ceil(t),u=Math.ceil(i),d=Math.ceil(r),p=t-a,f=i-l,m=r-c,_=e.image.data,g=4*(a+l*s+c*o),y=4*(a+l*s+d*o),x=4*(a+u*s+c*o),v=4*(a+u*s+d*o),b=4*(h+l*s+c*o),w=4*(h+l*s+d*o),T=4*(h+u*s+c*o),E=4*(h+u*s+d*o);if(g<0||E>=_.length)throw new Error("out of range");this.r=qr(qr(qr(_[g],_[y],m),qr(_[x],_[v],m),f),qr(qr(_[b],_[w],m),qr(_[T],_[E],m),f),p)/255*n,this.g=qr(qr(qr(_[g+1],_[y+1],m),qr(_[x+1],_[v+1],m),f),qr(qr(_[b+1],_[w+1],m),qr(_[T+1],_[E+1],m),f),p)/255*n,this.b=qr(qr(qr(_[g+2],_[y+2],m),qr(_[x+2],_[v+2],m),f),qr(qr(_[b+2],_[w+2],m),qr(_[T+2],_[E+2],m),f),p)/255*n,this.a=n}else this.r=t,this.g=i,this.b=r,this.a=n}toArray(){const{r:e,g:t,b:i,a:r}=this;return 0===r?[0,0,0,0]:[255*e/r,255*t/r,255*i/r,r]}toArray01(){const{r:e,g:t,b:i,a:r}=this;return 0===r?[0,0,0,0]:[e/r,t/r,i/r,r]}toArray01Scaled(e){const{r:t,g:i,b:r,a:n}=this;return 0===n?[0,0,0]:[t/n*e,i/n*e,r/n*e]}toArray01PremultipliedAlpha(){const{r:e,g:t,b:i,a:r}=this;return[e,t,i,r]}toArray01Linear(){const{r:e,g:t,b:i,a:r}=this;return 0===r?[0,0,0,0]:[Math.pow(e/r,2.2),Math.pow(t/r,2.2),Math.pow(i/r,2.2),r]}}function qr(e,t,i){return e*(1-i)+t*i}function Zr(e,t,i){return e.map(((e,r)=>qr(e,t[r],i)))}$r.black=new $r(0,0,0,1),$r.white=new $r(1,1,1,1),$r.transparent=new $r(0,0,0,0),$r.red=new $r(1,0,0,1),$r.blue=new $r(0,0,1,1);var Wr=Object.freeze({__proto__:null,array:Zr,color:function(e,t,i){return new $r(qr(e.r,t.r,i),qr(e.g,t.g,i),qr(e.b,t.b,i),qr(e.a,t.a,i))},number:qr});function Hr(e,...t){for(const i of t)for(const t in i)e[t]=i[t];return e}class Xr extends Error{constructor(e,t){super(t),this.message=t,this.key=e}}class Yr{constructor(e,t=[]){this.parent=e,this.bindings={};for(const[e,i]of t)this.bindings[e]=i}concat(e){return new Yr(this,e)}get(e){if(this.bindings[e])return this.bindings[e];if(this.parent)return this.parent.get(e);throw new Error(`${e} not found in scope.`)}has(e){return!!this.bindings[e]||!!this.parent&&this.parent.has(e)}}const Jr={kind:"null"},Kr={kind:"number"},Qr={kind:"string"},en={kind:"boolean"},tn={kind:"color"},rn={kind:"object"},nn={kind:"value"},on={kind:"collator"},sn={kind:"formatted"},an={kind:"resolvedImage"};function ln(e,t){return{kind:"array",itemType:e,N:t}}function cn(e){if("array"===e.kind){const t=cn(e.itemType);return"number"==typeof e.N?`array<${t}, ${e.N}>`:"value"===e.itemType.kind?"array":`array<${t}>`}return e.kind}const hn=[Jr,Kr,Qr,en,tn,sn,rn,ln(nn),an];function un(e,t){if("error"===t.kind)return null;if("array"===e.kind){if("array"===t.kind&&(0===t.N&&"value"===t.itemType.kind||!un(e.itemType,t.itemType))&&("number"!=typeof e.N||e.N===t.N))return null}else{if(e.kind===t.kind)return null;if("value"===e.kind)for(const e of hn)if(!un(e,t))return null}return`Expected ${cn(e)} but found ${cn(t)} instead.`}function dn(e,t){return t.some((t=>t.kind===e.kind))}function pn(e,t){return t.some((t=>"null"===t?null===e:"array"===t?Array.isArray(e):"object"===t?e&&!Array.isArray(e)&&"object"==typeof e:t===typeof e))}class fn{constructor(e,t,i){this.sensitivity=e?t?"variant":"case":t?"accent":"base",this.locale=i,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(e,t){return this.collator.compare(e,t)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class mn{constructor(e,t,i,r,n){this.text=e.normalize?e.normalize():e,this.image=t,this.scale=i,this.fontStack=r,this.textColor=n}}class _n{constructor(e){this.sections=e}static fromString(e){return new _n([new mn(e,null,null,null,null)])}isEmpty(){return 0===this.sections.length||!this.sections.some((e=>0!==e.text.length||e.image&&0!==e.image.namePrimary.length))}static factory(e){return e instanceof _n?e:_n.fromString(e)}toString(){return 0===this.sections.length?"":this.sections.map((e=>e.text)).join("")}serialize(){const e=["format"];for(const t of this.sections){if(t.image){e.push(["image",t.image.namePrimary]);continue}e.push(t.text);const i={};t.fontStack&&(i["text-font"]=["literal",t.fontStack.split(",")]),t.scale&&(i["font-scale"]=t.scale),t.textColor&&(i["text-color"]=["rgba"].concat(t.textColor.toRenderColor(null).toArray())),e.push(i)}return e}}class gn{constructor(e){this.namePrimary=e.namePrimary,e.nameSecondary&&(this.nameSecondary=e.nameSecondary),this.available=e.available}toString(){return this.nameSecondary?`[${this.namePrimary},${this.nameSecondary}]`:this.namePrimary}static fromString(e,t){return e?new gn({namePrimary:e,nameSecondary:t,available:!1}):null}serialize(){return this.nameSecondary?["image",this.namePrimary,this.nameSecondary]:["image",this.namePrimary]}}function yn(e,t,i,r){return"number"==typeof e&&e>=0&&e<=255&&"number"==typeof t&&t>=0&&t<=255&&"number"==typeof i&&i>=0&&i<=255?void 0===r||"number"==typeof r&&r>=0&&r<=1?null:`Invalid rgba value [${[e,t,i,r].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${("number"==typeof r?[e,t,i,r]:[e,t,i]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function xn(e){if(null===e)return!0;if("string"==typeof e)return!0;if("boolean"==typeof e)return!0;if("number"==typeof e)return!0;if(e instanceof $r)return!0;if(e instanceof fn)return!0;if(e instanceof _n)return!0;if(e instanceof gn)return!0;if(Array.isArray(e)){for(const t of e)if(!xn(t))return!1;return!0}if("object"==typeof e){for(const t in e)if(!xn(e[t]))return!1;return!0}return!1}function vn(e){if(null===e)return Jr;if("string"==typeof e)return Qr;if("boolean"==typeof e)return en;if("number"==typeof e)return Kr;if(e instanceof $r)return tn;if(e instanceof fn)return on;if(e instanceof _n)return sn;if(e instanceof gn)return an;if(Array.isArray(e)){const t=e.length;let i;for(const t of e){const e=vn(t);if(i){if(i===e)continue;i=nn;break}i=e}return ln(i||nn,t)}return rn}function bn(e){const t=typeof e;return null===e?"":"string"===t||"number"===t||"boolean"===t?String(e):e instanceof $r||e instanceof _n||e instanceof gn?e.toString():JSON.stringify(e)}class wn{constructor(e,t){this.type=e,this.value=t}static parse(e,t){if(2!==e.length)return t.error(`'literal' expression requires exactly one argument, but found ${e.length-1} instead.`);if(!xn(e[1]))return t.error("invalid value");const i=e[1];let r=vn(i);const n=t.expectedType;return"array"!==r.kind||0!==r.N||!n||"array"!==n.kind||"number"==typeof n.N&&0!==n.N||(r=n),new wn(r,i)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}serialize(){return"array"===this.type.kind||"object"===this.type.kind?["literal",this.value]:this.value instanceof $r?["rgba"].concat(this.value.toRenderColor(null).toArray()):this.value instanceof _n?this.value.serialize():this.value}}class Tn{constructor(e){this.name="ExpressionEvaluationError",this.message=e}toJSON(){return this.message}}const En={string:Qr,number:Kr,boolean:en,object:rn};class Sn{constructor(e,t){this.type=e,this.args=t}static parse(e,t){if(e.length<2)return t.error("Expected at least one argument.");let i,r=1;const n=e[0];if("array"===n){let n,o;if(e.length>2){const i=e[1];if("string"!=typeof i||!(i in En)||"object"===i)return t.error('The item type argument of "array" must be one of string, number, boolean',1);n=En[i],r++}else n=nn;if(e.length>3){if(null!==e[2]&&("number"!=typeof e[2]||e[2]<0||e[2]!==Math.floor(e[2])))return t.error('The length argument to "array" must be a positive integer literal',2);o=e[2],r++}i=ln(n,o)}else i=En[n];const o=[];for(;re.outputDefined()))}serialize(){const e=this.type,t=[e.kind];if("array"===e.kind){const i=e.itemType;if("string"===i.kind||"number"===i.kind||"boolean"===i.kind){t.push(i.kind);const r=e.N;("number"==typeof r||this.args.length>1)&&t.push(r)}}return t.concat(this.args.map((e=>e.serialize())))}}class Mn{constructor(e){this.type=sn,this.sections=e}static parse(e,t){if(e.length<2)return t.error("Expected at least one argument.");const i=e[1];if(!Array.isArray(i)&&"object"==typeof i)return t.error("First argument must be an image or text section.");const r=[];let n=!1;for(let i=1;i<=e.length-1;++i){const o=e[i];if(n&&"object"==typeof o&&!Array.isArray(o)){n=!1;let e=null;if(o["font-scale"]&&(e=t.parse(o["font-scale"],1,Kr),!e))return null;let i=null;if(o["text-font"]&&(i=t.parse(o["text-font"],1,ln(Qr)),!i))return null;let s=null;if(o["text-color"]&&(s=t.parse(o["text-color"],1,tn),!s))return null;const a=r[r.length-1];a.scale=e,a.font=i,a.textColor=s}else{const o=t.parse(e[i],1,nn);if(!o)return null;const s=o.type.kind;if("string"!==s&&"value"!==s&&"null"!==s&&"resolvedImage"!==s)return t.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");n=!0,r.push({content:o,scale:null,font:null,textColor:null})}}return new Mn(r)}evaluate(e){return new _n(this.sections.map((t=>{const i=t.content.evaluate(e);return vn(i)===an?new mn("",i,null,null,null):new mn(bn(i),null,t.scale?t.scale.evaluate(e):null,t.font?t.font.evaluate(e).join(","):null,t.textColor?t.textColor.evaluate(e):null)})))}eachChild(e){for(const t of this.sections)e(t.content),t.scale&&e(t.scale),t.font&&e(t.font),t.textColor&&e(t.textColor)}outputDefined(){return!1}serialize(){const e=["format"];for(const t of this.sections){e.push(t.content.serialize());const i={};t.scale&&(i["font-scale"]=t.scale.serialize()),t.font&&(i["text-font"]=t.font.serialize()),t.textColor&&(i["text-color"]=t.textColor.serialize()),e.push(i)}return e}}class An{constructor(e,t){this.type=an,this.inputPrimary=e,this.inputSecondary=t}static parse(e,t){if(e.length<2)return t.error("Expected two or more arguments.");const i=t.parse(e[1],1,Qr);if(!i)return t.error("No image name provided.");if(2===e.length)return new An(i);const r=t.parse(e[2],1,Qr);return r?new An(i,r):t.error("Secondary image variant is not a string.")}evaluate(e){const t=gn.fromString(this.inputPrimary.evaluate(e),this.inputSecondary?this.inputSecondary.evaluate(e):void 0);return t&&e.availableImages&&(t.available=e.availableImages.indexOf(t.namePrimary)>-1,t.nameSecondary&&t.available&&e.availableImages&&(t.available=e.availableImages.indexOf(t.nameSecondary)>-1)),t}eachChild(e){e(this.inputPrimary),this.inputSecondary&&e(this.inputSecondary)}outputDefined(){return!1}serialize(){return this.inputSecondary?["image",this.inputPrimary.serialize(),this.inputSecondary.serialize()]:["image",this.inputPrimary.serialize()]}}function In(e){return e instanceof Number?"number":e instanceof String?"string":e instanceof Boolean?"boolean":Array.isArray(e)?"array":null===e?"null":typeof e}const Cn={"to-boolean":en,"to-color":tn,"to-number":Kr,"to-string":Qr};class Pn{constructor(e,t){this.type=e,this.args=t}static parse(e,t){if(e.length<2)return t.error("Expected at least one argument.");const i=e[0],r=[];let n=Jr;if("to-array"===i){if(!Array.isArray(e[1]))return null;const i=e[1].length;if(t.expectedType){if("array"!==t.expectedType.kind)return t.error(`Expected ${t.expectedType.kind} but found array.`);n=ln(t.expectedType.itemType,i)}else{if(!(i>0&&xn(e[1][0])))return null;n=ln(vn(e[1][0]),i)}for(let o=0;o4?`Invalid rbga value ${JSON.stringify(t)}: expected an array containing either three or four numeric values.`:yn(t[0],t[1],t[2],t[3]),!i))return new $r(t[0]/255,t[1]/255,t[2]/255,t[3])}throw new Tn(i||`Could not parse color from value '${"string"==typeof t?t:String(JSON.stringify(t))}'`)}if("number"===this.type.kind){let t=null;for(const i of this.args){if(t=i.evaluate(e),null===t)return 0;const r=Number(t);if(!isNaN(r))return r}throw new Tn(`Could not convert ${JSON.stringify(t)} to number.`)}return"formatted"===this.type.kind?_n.fromString(bn(this.args[0].evaluate(e))):"resolvedImage"===this.type.kind?gn.fromString(bn(this.args[0].evaluate(e))):"array"===this.type.kind?this.args.map((t=>t.evaluate(e))):bn(this.args[0].evaluate(e))}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every((e=>e.outputDefined()))}serialize(){if("formatted"===this.type.kind)return new Mn([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if("resolvedImage"===this.type.kind)return new An(this.args[0]).serialize();const e="array"===this.type.kind?[]:[`to-${this.type.kind}`];return this.eachChild((t=>{e.push(t.serialize())})),e}}const zn=["Unknown","Point","LineString","Polygon"];class Dn{constructor(e,t){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null,this.featureTileCoord=null,this.featureDistanceData=null,this.scope=e,this.options=t}id(){return this.feature&&void 0!==this.feature.id?this.feature.id:null}geometryType(){return this.feature?"number"==typeof this.feature.type?zn[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||{}}measureLight(e){return this.globals.brightness||0}distanceFromCenter(){if(this.featureTileCoord&&this.featureDistanceData){const e=this.featureDistanceData.center,t=this.featureDistanceData.scale,{x:i,y:r}=this.featureTileCoord;return this.featureDistanceData.bearing[0]*(i*t-e[0])+this.featureDistanceData.bearing[1]*(r*t-e[1])}return 0}parseColor(e){let t=this._parseColorCache[e];return t||(t=this._parseColorCache[e]=$r.parse(e)),t}getConfig(e){return this.options?this.options.get(e):null}}class Rn{constructor(e,t,i,r,n){this.name=e,this.type=t,this._evaluate=i,this.args=r,this._overloadIndex=n}evaluate(e){if(!this._evaluate){const e=Rn.definitions[this.name];this._evaluate=Array.isArray(e)?e[2]:e.overloads[this._overloadIndex][1]}return this._evaluate(e,this.args)}eachChild(e){this.args.forEach(e)}outputDefined(){return!1}serialize(){return[this.name].concat(this.args.map((e=>e.serialize())))}static parse(e,t){const i=e[0],r=Rn.definitions[i];if(!r)return t.error(`Unknown expression "${i}". If you wanted a literal array, use ["literal", [...]].`,0);const n=Array.isArray(r)?r[0]:r.type,o=Array.isArray(r)?[[r[1],r[2]]]:r.overloads,s=[];let a=null,l=-1;for(const[r,c]of o){if(Array.isArray(r)&&r.length!==e.length-1)continue;s.push(r),l++,a=new Ko(t.registry,t.path,null,t.scope,void 0,t._scope,t.options);const o=[];let h=!1;for(let t=1;te))).map(Ln).join(" | "),r=[];for(let i=1;ii;){if(r-i>600){const o=r-i+1,s=t-i+1,a=Math.log(o),l=.5*Math.exp(2*a/3),c=.5*Math.sqrt(a*l*(o-l)/o)*(s-o/2<0?-1:1);On(e,t,Math.max(i,Math.floor(t-s*l/o+c)),Math.min(r,Math.floor(t+(o-s)*l/o+c)),n)}const o=e[t];let s=i,a=r;for(Bn(e,i,t),n(e[r],o)>0&&Bn(e,i,r);s0;)a--}0===n(e[i],o)?Bn(e,i,a):(a++,Bn(e,a,r)),a<=t&&(i=a+1),t<=a&&(r=a-1)}}function Bn(e,t,i){const r=e[t];e[t]=e[i],e[i]=r}function Fn(e,t){return et?1:0}function Nn(e){let t=0;for(let i,r,n=0,o=e.length,s=o-1;n=t[2]||e[1]<=t[1]||e[3]>=t[3])}function jn(e,t,i){const r=e[0]-t[0],n=e[1]-t[1],o=e[0]-i[0],s=e[1]-i[1];return r*s-o*n==0&&r*o<=0&&n*s<=0}function $n(e,t,i=!1){let r=!1;for(let a=0,l=t.length;a(n=e)[1]!=(s=h)[1]>n[1]&&n[0]<(s[0]-o[0])*(n[1]-o[1])/(s[1]-o[1])+o[0]&&(r=!r)}}var n,o,s;return r}function Gn(e,t,i,r){const n=r[0]-i[0],o=r[1]-i[1],s=(e[0]-i[0])*o-n*(e[1]-i[1]),a=(t[0]-i[0])*o-n*(t[1]-i[1]);return s>0&&a<0||s<0&&a>0}function qn(e,t,i,r){return 0!=(n=[r[0]-i[0],r[1]-i[1]])[0]*(o=[t[0]-e[0],t[1]-e[1]])[1]-n[1]*o[0]&&!(!Gn(e,t,i,r)||!Gn(i,r,e,t));var n,o}const Zn=8192;function Wn(e,t){const i=(180+e[0])/360,r=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e[1]*Math.PI/360)))/360,n=Math.pow(2,t.z);return[Math.round(i*n*Zn),Math.round(r*n*Zn)]}function Hn(e,t){for(let i=0;ii[2]){const t=.5*r;let n=e[0]-i[0]>t?-r:i[0]-e[0]>t?r:0;0===n&&(n=e[0]-i[2]>t?-r:i[2]-e[0]>t?r:0),e[0]+=n}Vn(t,e)}function to(e,t,i,r){const n=Math.pow(2,r.z)*Zn,o=[r.x*Zn,r.y*Zn],s=[];if(!e)return s;for(const r of e)for(const e of r){const r=[e.x+o[0],e.y+o[1]];eo(r,t,i,n),s.push(r)}return s}function io(e,t,i,r){const n=Math.pow(2,r.z)*Zn,o=[r.x*Zn,r.y*Zn],s=[];if(!e)return s;for(const i of e){const e=[];for(const r of i){const i=[r.x+o[0],r.y+o[1]];Vn(t,i),e.push(i)}s.push(e)}if(t[2]-t[0]<=n/2){(a=t)[0]=a[1]=1/0,a[2]=a[3]=-1/0;for(const e of s)for(const r of e)eo(r,t,i,n)}var a;return s}class ro{constructor(e,t){this.type=en,this.geojson=e,this.geometries=t}static parse(e,t){if(2!==e.length)return t.error(`'within' expression requires exactly one argument, but found ${e.length-1} instead.`);if(xn(e[1])){const t=e[1];if("FeatureCollection"===t.type)for(let e=0;et)return lo(n,o,(t-(i-s))/s)}return e[e.length-1]}pointToSegmentDistance(e,t,i){let[r,n]=t,o=co(i[0]-r)*this.kx,s=(i[1]-n)*this.ky;if(0!==o||0!==s){const t=(co(e[0]-r)*this.kx*o+(e[1]-n)*this.ky*s)/(o*o+s*s);t>1?(r=i[0],n=i[1]):t>0&&(r+=o/this.kx*t,n+=s/this.ky*t)}return o=co(e[0]-r)*this.kx,s=(e[1]-n)*this.ky,Math.sqrt(o*o+s*s)}pointOnLine(e,t){let i=1/0,r=e[0][0],n=e[0][1],o=0,s=0;for(let a=0;a1?(l=e[a+1][0],c=e[a+1][1]):d>0&&(l+=h/this.kx*d,c+=u/this.ky*d)),h=co(t[0]-l)*this.kx,u=(t[1]-c)*this.ky;const p=h*h+u*u;pn.index||r.index===n.index&&r.t>n.t){const e=r;r=n,n=e}const o=[r.point],s=r.index+1,a=n.index;!ao(i[s],o[0])&&s<=a&&o.push(i[s]);for(let e=s+1;e<=a;e++)o.push(i[e]);return ao(i[a],n.point)||o.push(n.point),o}lineSliceAlong(e,t,i){let r=0;const n=[];for(let o=0;oe&&0===n.length&&n.push(lo(s,a,(e-(r-l))/l)),r>=t)return n.push(lo(s,a,(t-(r-l))/l)),n;r>e&&n.push(a)}return n}bufferPoint(e,t){const i=t/this.ky,r=t/this.kx;return[e[0]-r,e[1]-i,e[0]+r,e[1]+i]}bufferBBox(e,t){const i=t/this.ky,r=t/this.kx;return[e[0]-r,e[1]-i,e[2]+r,e[3]+i]}insideBBox(e,t){return co(e[0]-t[0])>=0&&co(e[0]-t[2])<=0&&e[1]>=t[1]&&e[1]<=t[3]}}function ao(e,t){return e[0]===t[0]&&e[1]===t[1]}function lo(e,t,i){const r=co(t[0]-e[0]);return[e[0]+r*i,e[1]+(t[1]-e[1])*i]}function co(e){for(;e<-180;)e+=360;for(;e>180;)e-=360;return e}class ho{constructor(e=[],t=(e,t)=>et?1:0){if(this.data=e,this.length=this.data.length,this.compare=t,this.length>0)for(let e=(this.length>>1)-1;e>=0;e--)this._down(e)}push(e){this.data.push(e),this._up(this.length++)}pop(){if(0===this.length)return;const e=this.data[0],t=this.data.pop();return--this.length>0&&(this.data[0]=t,this._down(0)),e}peek(){return this.data[0]}_up(e){const{data:t,compare:i}=this,r=t[e];for(;e>0;){const n=e-1>>1,o=t[n];if(i(r,o)>=0)break;t[e]=o,e=n}t[e]=r}_down(e){const{data:t,compare:i}=this,r=this.length>>1,n=t[e];for(;e=0)break;t[e]=t[r],e=r}t[e]=n}}var uo=8192;function po(e,t){return t.dist-e.dist}const fo=100,mo=50;function _o(e){const t=[1/0,1/0,-1/0,-1/0];if(t.length!==e.length)return!1;for(let i=0;i=e[0]&&e[1]e[1])return[null,null];const i=go(e);if(t){if(2===i)return[e,null];const t=Math.floor(i/2);return[[e[0],e[0]+t],[e[0]+t,e[1]]]}{if(1===i)return[e,null];const t=Math.floor(i/2)-1;return[[e[0],e[0]+t],[e[0]+t+1,e[1]]]}}function vo(e,t){const i=[1/0,1/0,-1/0,-1/0];if(!yo(t,e.length))return i;for(let r=t[0];r<=t[1];++r)Vn(i,e[r]);return i}function bo(e){const t=[1/0,1/0,-1/0,-1/0];for(let i=0;it[2]&&(r=e[0]-t[2]),e[1]>t[3]&&(n=e[1]-t[3]),e[3]=r)return r;if(Un(n,o)){if(Lo(e,t))return 0}else if(Lo(t,e))return 0;let s=r;for(const r of e)for(let e=0,n=r.length,o=n-1;e=o)continue;const c=n.range1;if(go(c)<=a){if(!yo(c,e.length))return NaN;if(t){const t=Ro(e,c,i,r);if(0===(o=Math.min(o,t)))return o}else for(let t=c[0];t<=c[1];++t){const n=Do(e[t],i,r);if(0===(o=Math.min(o,n)))return o}}else{const i=xo(c,t);if(null!==i[0]){const t=wo(vo(e,i[0]),l,r);t=s)continue;const h=o.range1,u=o.range2;if(go(h)<=l&&go(u)<=c){if(!yo(h,e.length)||!yo(u,i.length))return NaN;if(t&&r?s=Math.min(s,Po(e,h,i,u,n)):t||r?t&&!r?s=Math.min(s,Io(i,u,e,h,n)):!t&&r&&(s=Math.min(s,Io(e,h,i,u,n))):s=Math.min(s,zo(e,h,i,u,n)),0===s)return s}else{const o=xo(h,t),l=xo(u,r);Oo(a,s,n,e,i,o[0],l[0]),Oo(a,s,n,e,i,o[0],l[1]),Oo(a,s,n,e,i,o[1],l[0]),Oo(a,s,n,e,i,o[1],l[1])}}return s}function No(e,t,i,r,n=1/0){let o=n;const s=vo(e,[0,e.length-1]);for(const n of i)if(!(o!==1/0&&wo(s,vo(n,[0,n.length-1]),r)>=o)&&(o=Math.min(o,Fo(e,t,n,!0,r,o)),0===o))return o;return o}function Vo(e,t,i,r,n=1/0){let o=n;const s=vo(e,[0,e.length-1]);for(const n of i){if(o!==1/0&&wo(s,bo(n),r)>=o)continue;const i=Bo(e,t,n,r,o);if(isNaN(i))return i;if(0===(o=Math.min(o,i)))return o}return o}function Uo(e){return"Point"===e||"MultiPoint"===e||"LineString"===e||"MultiLineString"===e||"Polygon"===e||"MultiPolygon"===e}class jo{constructor(e,t){this.type=Kr,this.geojson=e,this.geometries=t}static parse(e,t){if(2!==e.length)return t.error(`'distance' expression requires either one argument, but found ' ${e.length-1} instead.`);if(xn(e[1])){const t=e[1];if("FeatureCollection"===t.type){for(let e=0;ei&&(e=i),e}class qo{constructor(e,t,i){this.type=e,this.key=t,this.scope=i}static parse(e,t){let i=t.expectedType;if(null==i&&(i=nn),e.length<2||e.length>3)return t.error("Invalid number of arguments for 'config' expression.");const r=t.parse(e[1],1);if(!(r instanceof wn))return t.error("Key name of 'config' expression must be a string literal.");if(e.length>=3){const n=t.parse(e[2],2);return n instanceof wn?new qo(i,bn(r.value),bn(n.value)):t.error("Scope of 'config' expression must be a string literal.")}return new qo(i,bn(r.value))}evaluate(e){const t=[this.key,this.scope,e.scope].filter(Boolean).join("\x1f"),i=e.getConfig(t);if(!i)return null;const{type:r,value:n,values:o,minValue:s,maxValue:a,stepValue:l}=i,c=i.default.evaluate(e);let h=c;if(n){const t=e.scope;e.scope=(t||"").split("\x1f").slice(1).join("\x1f"),h=n.evaluate(e),e.scope=t}return r&&(h=$o(r,h)),void 0===h||void 0===s&&void 0===a&&void 0===l||("number"==typeof h?h=Go(h,s,a,l):Array.isArray(h)&&(h=h.map((e=>"number"==typeof e?Go(e,s,a,l):e)))),void 0!==n&&void 0!==h&&o&&!o.includes(h)&&(h=c,r&&(h=$o(r,h))),(r&&r!==this.type||void 0!==h&&vn(h)!==this.type)&&(h=$o(this.type.kind,h)),h}eachChild(){}outputDefined(){return!1}serialize(){const e=["config",this.key];return this.scope&&e.concat(this.key),e}}function Zo(e){if(e instanceof Rn){if("get"===e.name&&1===e.args.length)return!1;if("feature-state"===e.name)return!1;if("has"===e.name&&1===e.args.length)return!1;if("properties"===e.name||"geometry-type"===e.name||"id"===e.name)return!1;if(/^filter-/.test(e.name))return!1}if(e instanceof ro)return!1;if(e instanceof jo)return!1;let t=!0;return e.eachChild((e=>{t&&!Zo(e)&&(t=!1)})),t}function Wo(e){if(e instanceof Rn&&"feature-state"===e.name)return!1;let t=!0;return e.eachChild((e=>{t&&!Wo(e)&&(t=!1)})),t}function Ho(e){if(e instanceof qo)return new Set([e.key]);let t=new Set;return e.eachChild((e=>{t=new Set([...t,...Ho(e)])})),t}function Xo(e,t){if(e instanceof Rn&&t.indexOf(e.name)>=0)return!1;let i=!0;return e.eachChild((e=>{i&&!Xo(e,t)&&(i=!1)})),i}class Yo{constructor(e,t){this.type=t.type,this.name=e,this.boundExpression=t}static parse(e,t){if(2!==e.length||"string"!=typeof e[1])return t.error("'var' expression requires exactly one string literal argument.");const i=e[1];return t.scope.has(i)?new Yo(i,t.scope.get(i)):t.error(`Unknown variable "${i}". Make sure "${i}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(e){return this.boundExpression.evaluate(e)}eachChild(){}outputDefined(){return!1}serialize(){return["var",this.name]}}class Jo{constructor(e,t=[],i,r=new Yr,n=[],o,s){this.registry=e,this.path=t,this.key=t.map((e=>`[${e}]`)).join(""),this.scope=r,this.errors=n,this.expectedType=i,this._scope=o,this.options=s}parse(e,t,i,r,n={}){return t||i?this.concat(t,i,r)._parse(e,n):this._parse(e,n)}_parse(e,t){function i(e,t,i){return"assert"===i?new Sn(t,[e]):"coerce"===i?new Pn(t,[e]):e}if(null!==e&&"string"!=typeof e&&"boolean"!=typeof e&&"number"!=typeof e||(e=["literal",e]),Array.isArray(e)){if(0===e.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const r="string"==typeof e[0]?this.registry[e[0]]:void 0;if(r){let n=r.parse(e,this);if(!n)return null;if(this.expectedType){const e=this.expectedType,r=n.type;if("string"!==e.kind&&"number"!==e.kind&&"boolean"!==e.kind&&"object"!==e.kind&&"array"!==e.kind||"value"!==r.kind)if("color"!==e.kind&&"formatted"!==e.kind&&"resolvedImage"!==e.kind||"value"!==r.kind&&"string"!==r.kind){if(this.checkSubtype(e,r))return null}else n=i(n,e,t.typeAnnotation||"coerce");else n=i(n,e,t.typeAnnotation||"assert")}if(!(n instanceof wn)&&"resolvedImage"!==n.type.kind&&Qo(n)){const t=new Dn(this._scope,this.options);try{n=new wn(n.type,n.evaluate(t))}catch(e){return this.error(e.message),null}}return n}return Pn.parse(["to-array",e],this)}return this.error(void 0===e?"'undefined' value invalid. Use null instead.":"object"==typeof e?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof e} instead.`)}concat(e,t,i){const r="number"==typeof e?this.path.concat(e):this.path,n=i?this.scope.concat(i):this.scope;return new Jo(this.registry,r,t||null,n,this.errors,this._scope,this.options)}error(e,...t){const i=`${this.key}${t.map((e=>`[${e}]`)).join("")}`;this.errors.push(new Xr(i,e))}checkSubtype(e,t){const i=un(e,t);return i&&this.error(i),i}}var Ko=Jo;function Qo(e){if(e instanceof Yo)return Qo(e.boundExpression);if(e instanceof Rn&&"error"===e.name)return!1;if(e instanceof kn)return!1;if(e instanceof ro)return!1;if(e instanceof jo)return!1;if(e instanceof qo)return!1;const t=e instanceof Pn||e instanceof Sn;let i=!0;return e.eachChild((e=>{i=t?i&&Qo(e):i&&e instanceof wn})),!!i&&Zo(e)&&Xo(e,["zoom","heatmap-density","line-progress","raster-value","sky-radial-progress","accumulated","is-supported-script","pitch","distance-from-center","measure-light","raster-particle-speed"])}function es(e,t){const i=e.length-1;let r,n,o=0,s=i,a=0;for(;o<=s;)if(a=Math.floor((o+s)/2),r=e[a],n=e[a+1],r<=t){if(a===i||tt))throw new Tn("Input is not a number.");s=a-1}return 0}class ts{constructor(e,t,i){this.type=e,this.input=t,this.labels=[],this.outputs=[];for(const[e,t]of i)this.labels.push(e),this.outputs.push(t)}static parse(e,t){if(e.length-1<4)return t.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return t.error("Expected an even number of arguments.");const i=t.parse(e[1],1,Kr);if(!i)return null;const r=[];let n=null;t.expectedType&&"value"!==t.expectedType.kind&&(n=t.expectedType);for(let i=1;i=o)return t.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',a);const c=t.parse(s,l,n);if(!c)return null;n=n||c.type,r.push([o,c])}return new ts(n,i,r)}evaluate(e){const t=this.labels,i=this.outputs;if(1===t.length)return i[0].evaluate(e);const r=this.input.evaluate(e);if(r<=t[0])return i[0].evaluate(e);const n=t.length;return r>=t[n-1]?i[n-1].evaluate(e):i[es(t,r)].evaluate(e)}eachChild(e){e(this.input);for(const t of this.outputs)e(t)}outputDefined(){return this.outputs.every((e=>e.outputDefined()))}serialize(){const e=["step",this.input.serialize()];for(let t=0;t0&&e.push(this.labels[t]),e.push(this.outputs[t].serialize());return e}}const is=.95047,rs=1.08883,ns=.13793103448275862,os=.20689655172413793,ss=.12841854934601665,as=.008856451679035631,ls=Math.PI/180,cs=180/Math.PI;function hs(e){return e>as?Math.pow(e,.3333333333333333):e/ss+ns}function us(e){return e>os?e*e*e:ss*(e-ns)}function ds(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,.4166666666666667)-.055)}function ps(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function fs(e){const t=ps(e.r),i=ps(e.g),r=ps(e.b),n=hs((.4124564*t+.3575761*i+.1804375*r)/is),o=hs((.2126729*t+.7151522*i+.072175*r)/1);return{l:116*o-16,a:500*(n-o),b:200*(o-hs((.0193339*t+.119192*i+.9503041*r)/rs)),alpha:e.a}}function ms(e){let t=(e.l+16)/116,i=isNaN(e.a)?t:t+e.a/500,r=isNaN(e.b)?t:t-e.b/200;return t=1*us(t),i=is*us(i),r=rs*us(r),new $r(ds(3.2404542*i-1.5371385*t-.4985314*r),ds(-.969266*i+1.8760108*t+.041556*r),ds(.0556434*i-.2040259*t+1.0572252*r),e.alpha)}function _s(e,t,i){const r=t-e;return e+i*(r>180||r<-180?r-360*Math.round(r/360):r)}const gs={forward:fs,reverse:ms,interpolate:function(e,t,i){return{l:qr(e.l,t.l,i),a:qr(e.a,t.a,i),b:qr(e.b,t.b,i),alpha:qr(e.alpha,t.alpha,i)}}},ys={forward:function(e){const{l:t,a:i,b:r}=fs(e),n=Math.atan2(r,i)*cs;return{h:n<0?n+360:n,c:Math.sqrt(i*i+r*r),l:t,alpha:e.a}},reverse:function(e){const t=e.h*ls,i=e.c;return ms({l:e.l,a:Math.cos(t)*i,b:Math.sin(t)*i,alpha:e.alpha})},interpolate:function(e,t,i){return{h:_s(e.h,t.h,i),c:qr(e.c,t.c,i),l:qr(e.l,t.l,i),alpha:qr(e.alpha,t.alpha,i)}}};var xs=Object.freeze({__proto__:null,hcl:ys,lab:gs});class vs{constructor(e,t,i,r,n){this.type=e,this.operator=t,this.interpolation=i,this.input=r,this.labels=[],this.outputs=[];for(const[e,t]of n)this.labels.push(e),this.outputs.push(t)}static interpolationFactor(e,t,i,r){let n=0;if("exponential"===e.name)n=bs(t,e.base,i,r);else if("linear"===e.name)n=bs(t,1,i,r);else if("cubic-bezier"===e.name){const o=e.controlPoints;n=new Ft(o[0],o[1],o[2],o[3]).solve(bs(t,1,i,r))}return n}static parse(e,t){let[i,r,n,...o]=e;if(!Array.isArray(r)||0===r.length)return t.error("Expected an interpolation type expression.",1);if("linear"===r[0])r={name:"linear"};else if("exponential"===r[0]){const e=r[1];if("number"!=typeof e)return t.error("Exponential interpolation requires a numeric base.",1,1);r={name:"exponential",base:e}}else{if("cubic-bezier"!==r[0])return t.error(`Unknown interpolation type ${String(r[0])}`,1,0);{const e=r.slice(1);if(4!==e.length||e.some((e=>"number"!=typeof e||e<0||e>1)))return t.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);r={name:"cubic-bezier",controlPoints:e}}}if(e.length-1<4)return t.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return t.error("Expected an even number of arguments.");if(n=t.parse(n,2,Kr),!n)return null;const s=[];let a=null;"interpolate-hcl"===i||"interpolate-lab"===i?a=tn:t.expectedType&&"value"!==t.expectedType.kind&&(a=t.expectedType);for(let e=0;e=i)return t.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',n);const c=t.parse(r,l,a);if(!c)return null;a=a||c.type,s.push([i,c])}return"number"===a.kind||"color"===a.kind||"array"===a.kind&&"number"===a.itemType.kind&&"number"==typeof a.N?new vs(a,i,r,n,s):t.error(`Type ${cn(a)} is not interpolatable.`)}evaluate(e){const t=this.labels,i=this.outputs;if(1===t.length)return i[0].evaluate(e);const r=this.input.evaluate(e);if(r<=t[0])return i[0].evaluate(e);const n=t.length;if(r>=t[n-1])return i[n-1].evaluate(e);const o=es(t,r),s=vs.interpolationFactor(this.interpolation,r,t[o],t[o+1]),a=i[o].evaluate(e),l=i[o+1].evaluate(e);return"interpolate"===this.operator?Wr[this.type.kind.toLowerCase()](a,l,s):"interpolate-hcl"===this.operator?ys.reverse(ys.interpolate(ys.forward(a),ys.forward(l),s)):gs.reverse(gs.interpolate(gs.forward(a),gs.forward(l),s))}eachChild(e){e(this.input);for(const t of this.outputs)e(t)}outputDefined(){return this.outputs.every((e=>e.outputDefined()))}serialize(){let e;e="linear"===this.interpolation.name?["linear"]:"exponential"===this.interpolation.name?1===this.interpolation.base?["linear"]:["exponential",this.interpolation.base]:["cubic-bezier"].concat(this.interpolation.controlPoints);const t=[this.operator,e,this.input.serialize()];for(let e=0;eun(r,e.type)));return new ws(o?nn:i,n)}evaluate(e){let t,i=null,r=0;for(const n of this.args){if(r++,i=n.evaluate(e),i&&i instanceof gn&&!i.available&&(t||(t=i),i=null,r===this.args.length))return t;if(null!==i)break}return i}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every((e=>e.outputDefined()))}serialize(){const e=["coalesce"];return this.eachChild((t=>{e.push(t.serialize())})),e}}class Ts{constructor(e,t){this.type=t.type,this.bindings=[].concat(e),this.result=t}evaluate(e){return this.result.evaluate(e)}eachChild(e){for(const t of this.bindings)e(t[1]);e(this.result)}static parse(e,t){if(e.length<4)return t.error(`Expected at least 3 arguments, but found ${e.length-1} instead.`);const i=[];for(let r=1;r=i.length)throw new Tn(`Array index out of bounds: ${t} > ${i.length-1}.`);if(t!==Math.floor(t))throw new Tn(`Array index must be an integer, but found ${t} instead.`);return i[t]}eachChild(e){e(this.index),e(this.input)}outputDefined(){return!1}serialize(){return["at",this.index.serialize(),this.input.serialize()]}}class Ss{constructor(e,t){this.type=en,this.needle=e,this.haystack=t}static parse(e,t){if(3!==e.length)return t.error(`Expected 2 arguments, but found ${e.length-1} instead.`);const i=t.parse(e[1],1,nn),r=t.parse(e[2],2,nn);return i&&r?dn(i.type,[en,Qr,Kr,Jr,nn])?new Ss(i,r):t.error(`Expected first argument to be of type boolean, string, number or null, but found ${cn(i.type)} instead`):null}evaluate(e){const t=this.needle.evaluate(e),i=this.haystack.evaluate(e);if(null==i)return!1;if(!pn(t,["boolean","string","number","null"]))throw new Tn(`Expected first argument to be of type boolean, string, number or null, but found ${cn(vn(t))} instead.`);if(!pn(i,["string","array"]))throw new Tn(`Expected second argument to be of type array or string, but found ${cn(vn(i))} instead.`);return i.indexOf(t)>=0}eachChild(e){e(this.needle),e(this.haystack)}outputDefined(){return!0}serialize(){return["in",this.needle.serialize(),this.haystack.serialize()]}}class Ms{constructor(e,t,i){this.type=Kr,this.needle=e,this.haystack=t,this.fromIndex=i}static parse(e,t){if(e.length<=2||e.length>=5)return t.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);const i=t.parse(e[1],1,nn),r=t.parse(e[2],2,nn);if(!i||!r)return null;if(!dn(i.type,[en,Qr,Kr,Jr,nn]))return t.error(`Expected first argument to be of type boolean, string, number or null, but found ${cn(i.type)} instead`);if(4===e.length){const n=t.parse(e[3],3,Kr);return n?new Ms(i,r,n):null}return new Ms(i,r)}evaluate(e){const t=this.needle.evaluate(e),i=this.haystack.evaluate(e);if(!pn(t,["boolean","string","number","null"]))throw new Tn(`Expected first argument to be of type boolean, string, number or null, but found ${cn(vn(t))} instead.`);if(!pn(i,["string","array"]))throw new Tn(`Expected second argument to be of type array or string, but found ${cn(vn(i))} instead.`);if(this.fromIndex){const r=this.fromIndex.evaluate(e);return i.indexOf(t,r)}return i.indexOf(t)}eachChild(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)}outputDefined(){return!1}serialize(){if(null!=this.fromIndex&&void 0!==this.fromIndex){const e=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),e]}return["index-of",this.needle.serialize(),this.haystack.serialize()]}}class As{constructor(e,t,i,r,n,o){this.inputType=e,this.type=t,this.input=i,this.cases=r,this.outputs=n,this.otherwise=o}static parse(e,t){if(e.length<5)return t.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if(e.length%2!=1)return t.error("Expected an even number of arguments.");let i,r;t.expectedType&&"value"!==t.expectedType.kind&&(r=t.expectedType);const n={},o=[];for(let s=2;sNumber.MAX_SAFE_INTEGER)return c.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if("number"==typeof e&&Math.floor(e)!==e)return c.error("Numeric branch labels must be integer values.");if(i){if(c.checkSubtype(i,vn(e)))return null}else i=vn(e);if(void 0!==n[String(e)])return c.error("Branch labels must be unique.");n[String(e)]=o.length}const h=t.parse(l,s,r);if(!h)return null;r=r||h.type,o.push(h)}const s=t.parse(e[1],1,nn);if(!s)return null;const a=t.parse(e[e.length-1],e.length-1,r);return a?"value"!==s.type.kind&&t.concat(1).checkSubtype(i,s.type)?null:new As(i,r,s,n,o,a):null}evaluate(e){const t=this.input.evaluate(e);return(vn(t)===this.inputType&&this.outputs[this.cases[t]]||this.otherwise).evaluate(e)}eachChild(e){e(this.input),this.outputs.forEach(e),e(this.otherwise)}outputDefined(){return this.outputs.every((e=>e.outputDefined()))&&this.otherwise.outputDefined()}serialize(){const e=["match",this.input.serialize()],t=Object.keys(this.cases).sort(),i=[],r={};for(const e of t){const t=r[this.cases[e]];void 0===t?(r[this.cases[e]]=i.length,i.push([this.cases[e],[e]])):i[t][1].push(e)}const n=e=>"number"===this.inputType.kind?Number(e):e;for(const[t,r]of i)e.push(1===r.length?n(r[0]):r.map(n)),e.push(this.outputs[t].serialize());return e.push(this.otherwise.serialize()),e}}class Is{constructor(e,t,i){this.type=e,this.branches=t,this.otherwise=i}static parse(e,t){if(e.length<4)return t.error(`Expected at least 3 arguments, but found only ${e.length-1}.`);if(e.length%2!=0)return t.error("Expected an odd number of arguments.");let i;t.expectedType&&"value"!==t.expectedType.kind&&(i=t.expectedType);const r=[];for(let n=1;nt.outputDefined()))&&this.otherwise.outputDefined()}serialize(){const e=["case"];return this.eachChild((t=>{e.push(t.serialize())})),e}}class Cs{constructor(e,t,i,r){this.type=e,this.input=t,this.beginIndex=i,this.endIndex=r}static parse(e,t){if(e.length<=2||e.length>=5)return t.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);const i=t.parse(e[1],1,nn),r=t.parse(e[2],2,Kr);if(!i||!r)return null;if(!dn(i.type,[ln(nn),Qr,nn]))return t.error(`Expected first argument to be of type array or string, but found ${cn(i.type)} instead`);if(4===e.length){const n=t.parse(e[3],3,Kr);return n?new Cs(i.type,i,r,n):null}return new Cs(i.type,i,r)}evaluate(e){const t=this.input.evaluate(e),i=this.beginIndex.evaluate(e);if(!pn(t,["string","array"]))throw new Tn(`Expected first argument to be of type array or string, but found ${cn(vn(t))} instead.`);if(this.endIndex){const r=this.endIndex.evaluate(e);return t.slice(i,r)}return t.slice(i)}eachChild(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)}outputDefined(){return!1}serialize(){if(null!=this.endIndex&&void 0!==this.endIndex){const e=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),e]}return["slice",this.input.serialize(),this.beginIndex.serialize()]}}function Ps(e,t){return"=="===e||"!="===e?"boolean"===t.kind||"string"===t.kind||"number"===t.kind||"null"===t.kind||"value"===t.kind:"string"===t.kind||"number"===t.kind||"value"===t.kind}function zs(e,t,i,r){return 0===r.compare(t,i)}function Ds(e,t,i){const r="=="!==e&&"!="!==e;return class n{constructor(e,t,i){this.type=en,this.lhs=e,this.rhs=t,this.collator=i,this.hasUntypedArgument="value"===e.type.kind||"value"===t.type.kind}static parse(e,t){if(3!==e.length&&4!==e.length)return t.error("Expected two or three arguments.");const i=e[0];let o=t.parse(e[1],1,nn);if(!o)return null;if(!Ps(i,o.type))return t.concat(1).error(`"${i}" comparisons are not supported for type '${cn(o.type)}'.`);let s=t.parse(e[2],2,nn);if(!s)return null;if(!Ps(i,s.type))return t.concat(2).error(`"${i}" comparisons are not supported for type '${cn(s.type)}'.`);if(o.type.kind!==s.type.kind&&"value"!==o.type.kind&&"value"!==s.type.kind)return t.error(`Cannot compare types '${cn(o.type)}' and '${cn(s.type)}'.`);r&&("value"===o.type.kind&&"value"!==s.type.kind?o=new Sn(s.type,[o]):"value"!==o.type.kind&&"value"===s.type.kind&&(s=new Sn(o.type,[s])));let a=null;if(4===e.length){if("string"!==o.type.kind&&"string"!==s.type.kind&&"value"!==o.type.kind&&"value"!==s.type.kind)return t.error("Cannot use collator to compare non-string types.");if(a=t.parse(e[3],3,on),!a)return null}return new n(o,s,a)}evaluate(n){const o=this.lhs.evaluate(n),s=this.rhs.evaluate(n);if(r&&this.hasUntypedArgument){const t=vn(o),i=vn(s);if(t.kind!==i.kind||"string"!==t.kind&&"number"!==t.kind)throw new Tn(`Expected arguments for "${e}" to be (string, string) or (number, number), but found (${t.kind}, ${i.kind}) instead.`)}if(this.collator&&!r&&this.hasUntypedArgument){const e=vn(o),i=vn(s);if("string"!==e.kind||"string"!==i.kind)return t(n,o,s)}return this.collator?i(n,o,s,this.collator.evaluate(n)):t(n,o,s)}eachChild(e){e(this.lhs),e(this.rhs),this.collator&&e(this.collator)}outputDefined(){return!0}serialize(){const t=[e];return this.eachChild((e=>{t.push(e.serialize())})),t}}}const Rs=Ds("==",(function(e,t,i){return t===i}),zs),Ls=Ds("!=",(function(e,t,i){return t!==i}),(function(e,t,i,r){return!zs(0,t,i,r)})),ks=Ds("<",(function(e,t,i){return t",(function(e,t,i){return t>i}),(function(e,t,i,r){return r.compare(t,i)>0})),Bs=Ds("<=",(function(e,t,i){return t<=i}),(function(e,t,i,r){return r.compare(t,i)<=0})),Fs=Ds(">=",(function(e,t,i){return t>=i}),(function(e,t,i,r){return r.compare(t,i)>=0}));class Ns{constructor(e,t,i,r,n,o){this.type=Qr,this.number=e,this.locale=t,this.currency=i,this.unit=r,this.minFractionDigits=n,this.maxFractionDigits=o}static parse(e,t){if(3!==e.length)return t.error("Expected two arguments.");const i=t.parse(e[1],1,Kr);if(!i)return null;const r=e[2];if("object"!=typeof r||Array.isArray(r))return t.error("NumberFormat options argument must be an object.");let n=null;if(r.locale&&(n=t.parse(r.locale,1,Qr),!n))return null;let o=null;if(r.currency&&(o=t.parse(r.currency,1,Qr),!o))return null;let s=null;if(r.unit&&(s=t.parse(r.unit,1,Qr),!s))return null;let a=null;if(r["min-fraction-digits"]&&(a=t.parse(r["min-fraction-digits"],1,Kr),!a))return null;let l=null;return r["max-fraction-digits"]&&(l=t.parse(r["max-fraction-digits"],1,Kr),!l)?null:new Ns(i,n,o,s,a,l)}evaluate(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:(this.currency?"currency":this.unit&&"unit")||"decimal",currency:this.currency?this.currency.evaluate(e):void 0,unit:this.unit?this.unit.evaluate(e):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(e):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(e):void 0}).format(this.number.evaluate(e))}eachChild(e){e(this.number),this.locale&&e(this.locale),this.currency&&e(this.currency),this.unit&&e(this.unit),this.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)}outputDefined(){return!1}serialize(){const e={};return this.locale&&(e.locale=this.locale.serialize()),this.currency&&(e.currency=this.currency.serialize()),this.unit&&(e.unit=this.unit.serialize()),this.minFractionDigits&&(e["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(e["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),e]}}class Vs{constructor(e){this.type=Kr,this.input=e}static parse(e,t){if(2!==e.length)return t.error(`Expected 1 argument, but found ${e.length-1} instead.`);const i=t.parse(e[1],1);return i?"array"!==i.type.kind&&"string"!==i.type.kind&&"value"!==i.type.kind?t.error(`Expected argument of type string or array, but found ${cn(i.type)} instead.`):new Vs(i):null}evaluate(e){const t=this.input.evaluate(e);if("string"==typeof t)return t.length;if(Array.isArray(t))return t.length;throw new Tn(`Expected value to be of type string or array, but found ${cn(vn(t))} instead.`)}eachChild(e){e(this.input)}outputDefined(){return!1}serialize(){const e=["length"];return this.eachChild((t=>{e.push(t.serialize())})),e}}function Us(e){return function(){e=1831565813+(e|=0)|0;let t=Math.imul(e^e>>>15,1|e);return t=t+Math.imul(t^t>>>7,61|t)^t,((t^t>>>14)>>>0)/4294967296}}const js={"==":Rs,"!=":Ls,">":Os,"<":ks,">=":Fs,"<=":Bs,array:Sn,at:Es,boolean:Sn,case:Is,coalesce:ws,collator:kn,format:Mn,image:An,in:Ss,"index-of":Ms,interpolate:vs,"interpolate-hcl":vs,"interpolate-lab":vs,length:Vs,let:Ts,literal:wn,match:As,number:Sn,"number-format":Ns,object:Sn,slice:Cs,step:ts,string:Sn,"to-boolean":Pn,"to-color":Pn,"to-number":Pn,"to-string":Pn,var:Yo,within:ro,distance:jo,config:qo};function $s(e,[t,i,r,n]){t=t.evaluate(e),i=i.evaluate(e),r=r.evaluate(e);const o=n?n.evaluate(e):1,s=yn(t,i,r,o);if(s)throw new Tn(s);return new $r(t/255*o,i/255*o,r/255*o,o)}function Gs(e,[t,i,r,n]){t=t.evaluate(e),i=i.evaluate(e),r=r.evaluate(e);const o=n?n.evaluate(e):1,s=(function(e,t,i,r){return"number"==typeof e&&e>=0&&e<=360?"number"==typeof t&&t>=0&&t<=100&&"number"==typeof i&&i>=0&&i<=100?void 0===r||"number"==typeof r&&r>=0&&r<=1?null:`Invalid hsla value [${[e,t,i,r].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid hsla value [${("number"==typeof r?[e,t,i,r]:[e,t,i]).join(", ")}]: 's', and 'l' must be between 0 and 100.`:`Invalid hsla value [${("number"==typeof r?[e,t,i,r]:[e,t,i]).join(", ")}]: 'h' must be between 0 and 360.`})(t,i,r,o);if(s)throw new Tn(s);const a=`hsla(${t}, ${i}%, ${r}%, ${o})`,l=$r.parse(a);if(!l)throw new Tn(`Failed to parse HSLA color: ${a}`);return l}function qs(e,t){return e in t}function Zs(e,t){const i=t[e];return void 0===i?null:i}function Ws(e){return{type:e}}function Hs(e){return{result:"success",value:e}}function Xs(e){return{result:"error",value:e}}function Ys(e,t){return!!e&&!!e.parameters&&e.parameters.indexOf(t)>-1}function Js(e){return"data-driven"===e["property-type"]}function Ks(e){return Ys(e.expression,"measure-light")}function Qs(e){return Ys(e.expression,"zoom")}function ea(e){return!!e.expression&&e.expression.interpolated}function ta(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}function ia(e){return e}function ra(e,t){const i="color"===t.type,r=e.stops&&"object"==typeof e.stops[0][0],n=r||!(r||void 0!==e.property),o=e.type||(ea(t)?"exponential":"interval");if(i&&((e=Hr({},e)).stops&&(e.stops=e.stops.map((e=>[e[0],$r.parse(e[1])]))),e.default=$r.parse(e.default?e.default:t.default)),e.colorSpace&&"rgb"!==e.colorSpace&&!xs[e.colorSpace])throw new Error(`Unknown color space: ${e.colorSpace}`);let s,a,l;if("exponential"===o)s=aa;else if("interval"===o)s=sa;else if("categorical"===o){s=oa,a=Object.create(null);for(const t of e.stops)a[t[0]]=t[1];l=typeof e.stops[0][0]}else{if("identity"!==o)throw new Error(`Unknown function type "${o}"`);s=la}if(r){const i={},r=[];for(let t=0;te[0])),evaluate:({zoom:i},r)=>aa({stops:n,base:e.base},t,i).evaluate(i,r)}}if(n){const i="exponential"===o?{name:"exponential",base:void 0!==e.base?e.base:1}:null;return{kind:"camera",interpolationType:i,interpolationFactor:vs.interpolationFactor.bind(void 0,i),zoomStops:e.stops.map((e=>e[0])),evaluate:({zoom:i})=>s(e,t,i,a,l)}}return{kind:"source",evaluate(i,r){const n=r&&r.properties?r.properties[e.property]:void 0;return void 0===n?na(e.default,t.default):s(e,t,n,a,l)}}}function na(e,t,i){return void 0!==e?e:void 0!==t?t:void 0!==i?i:void 0}function oa(e,t,i,r,n){return na(typeof i===n?r[i]:void 0,e.default,t.default)}function sa(e,t,i){if("number"!==In(i))return na(e.default,t.default);const r=e.stops.length;if(1===r)return e.stops[0][1];if(i<=e.stops[0][0])return e.stops[0][1];if(i>=e.stops[r-1][0])return e.stops[r-1][1];const n=es(e.stops.map((e=>e[0])),i);return e.stops[n][1]}function aa(e,t,i){const r=void 0!==e.base?e.base:1;if("number"!==In(i))return na(e.default,t.default);const n=e.stops.length;if(1===n)return e.stops[0][1];if(i<=e.stops[0][0])return e.stops[0][1];if(i>=e.stops[n-1][0])return e.stops[n-1][1];const o=es(e.stops.map((e=>e[0])),i),s=(function(e,t,i,r){const n=r-i,o=e-i;return 0===n?0:1===t?o/n:(Math.pow(t,o)-1)/(Math.pow(t,n)-1)})(i,r,e.stops[o][0],e.stops[o+1][0]),a=e.stops[o][1],l=e.stops[o+1][1];let c=Wr[t.type]||ia;if(e.colorSpace&&"rgb"!==e.colorSpace){const t=xs[e.colorSpace];c=(e,i)=>t.reverse(t.interpolate(t.forward(e),t.forward(i),s))}return"function"==typeof a.evaluate?{evaluate(...e){const t=a.evaluate.apply(void 0,e),i=l.evaluate.apply(void 0,e);if(void 0!==t&&void 0!==i)return c(t,i,s)}}:c(a,l,s)}function la(e,t,i){return"color"===t.type?i=$r.parse(i):"formatted"===t.type?i=_n.fromString(i.toString()):"resolvedImage"===t.type?i=gn.fromString(i.toString()):In(i)===t.type||"enum"===t.type&&t.values[i]||(i=void 0),na(i,e.default,t.default)}Rn.register(js,{error:[{kind:"error"},[Qr],(e,[t])=>{throw new Tn(t.evaluate(e))}],typeof:[Qr,[nn],(e,[t])=>cn(vn(t.evaluate(e)))],"to-rgba":[ln(Kr,4),[tn],(e,[t])=>t.evaluate(e).toRenderColor(null).toArray()],rgb:[tn,[Kr,Kr,Kr],$s],rgba:[tn,[Kr,Kr,Kr,Kr],$s],hsl:[tn,[Kr,Kr,Kr],Gs],hsla:[tn,[Kr,Kr,Kr,Kr],Gs],has:{type:en,overloads:[[[Qr],(e,[t])=>qs(t.evaluate(e),e.properties())],[[Qr,rn],(e,[t,i])=>qs(t.evaluate(e),i.evaluate(e))]]},get:{type:nn,overloads:[[[Qr],(e,[t])=>Zs(t.evaluate(e),e.properties())],[[Qr,rn],(e,[t,i])=>Zs(t.evaluate(e),i.evaluate(e))]]},"feature-state":[nn,[Qr],(e,[t])=>Zs(t.evaluate(e),e.featureState||{})],properties:[rn,[],e=>e.properties()],"geometry-type":[Qr,[],e=>e.geometryType()],id:[nn,[],e=>e.id()],zoom:[Kr,[],e=>e.globals.zoom],pitch:[Kr,[],e=>e.globals.pitch||0],"distance-from-center":[Kr,[],e=>e.distanceFromCenter()],"measure-light":[Kr,[Qr],(e,[t])=>e.measureLight(t.evaluate(e))],"heatmap-density":[Kr,[],e=>e.globals.heatmapDensity||0],"line-progress":[Kr,[],e=>e.globals.lineProgress||0],"raster-value":[Kr,[],e=>e.globals.rasterValue||0],"raster-particle-speed":[Kr,[],e=>e.globals.rasterParticleSpeed||0],"sky-radial-progress":[Kr,[],e=>e.globals.skyRadialProgress||0],accumulated:[nn,[],e=>void 0===e.globals.accumulated?null:e.globals.accumulated],"+":[Kr,Ws(Kr),(e,t)=>{let i=0;for(const r of t)i+=r.evaluate(e);return i}],"*":[Kr,Ws(Kr),(e,t)=>{let i=1;for(const r of t)i*=r.evaluate(e);return i}],"-":{type:Kr,overloads:[[[Kr,Kr],(e,[t,i])=>t.evaluate(e)-i.evaluate(e)],[[Kr],(e,[t])=>-t.evaluate(e)]]},"/":[Kr,[Kr,Kr],(e,[t,i])=>t.evaluate(e)/i.evaluate(e)],"%":[Kr,[Kr,Kr],(e,[t,i])=>t.evaluate(e)%i.evaluate(e)],ln2:[Kr,[],()=>Math.LN2],pi:[Kr,[],()=>Math.PI],e:[Kr,[],()=>Math.E],"^":[Kr,[Kr,Kr],(e,[t,i])=>Math.pow(t.evaluate(e),i.evaluate(e))],sqrt:[Kr,[Kr],(e,[t])=>Math.sqrt(t.evaluate(e))],log10:[Kr,[Kr],(e,[t])=>Math.log(t.evaluate(e))/Math.LN10],ln:[Kr,[Kr],(e,[t])=>Math.log(t.evaluate(e))],log2:[Kr,[Kr],(e,[t])=>Math.log(t.evaluate(e))/Math.LN2],sin:[Kr,[Kr],(e,[t])=>Math.sin(t.evaluate(e))],cos:[Kr,[Kr],(e,[t])=>Math.cos(t.evaluate(e))],tan:[Kr,[Kr],(e,[t])=>Math.tan(t.evaluate(e))],asin:[Kr,[Kr],(e,[t])=>Math.asin(t.evaluate(e))],acos:[Kr,[Kr],(e,[t])=>Math.acos(t.evaluate(e))],atan:[Kr,[Kr],(e,[t])=>Math.atan(t.evaluate(e))],min:[Kr,Ws(Kr),(e,t)=>Math.min(...t.map((t=>t.evaluate(e))))],max:[Kr,Ws(Kr),(e,t)=>Math.max(...t.map((t=>t.evaluate(e))))],abs:[Kr,[Kr],(e,[t])=>Math.abs(t.evaluate(e))],round:[Kr,[Kr],(e,[t])=>{const i=t.evaluate(e);return i<0?-Math.round(-i):Math.round(i)}],floor:[Kr,[Kr],(e,[t])=>Math.floor(t.evaluate(e))],ceil:[Kr,[Kr],(e,[t])=>Math.ceil(t.evaluate(e))],"filter-==":[en,[Qr,nn],(e,[t,i])=>e.properties()[t.value]===i.value],"filter-id-==":[en,[nn],(e,[t])=>e.id()===t.value],"filter-type-==":[en,[Qr],(e,[t])=>e.geometryType()===t.value],"filter-<":[en,[Qr,nn],(e,[t,i])=>{const r=e.properties()[t.value],n=i.value;return typeof r==typeof n&&r{const i=e.id(),r=t.value;return typeof i==typeof r&&i":[en,[Qr,nn],(e,[t,i])=>{const r=e.properties()[t.value],n=i.value;return typeof r==typeof n&&r>n}],"filter-id->":[en,[nn],(e,[t])=>{const i=e.id(),r=t.value;return typeof i==typeof r&&i>r}],"filter-<=":[en,[Qr,nn],(e,[t,i])=>{const r=e.properties()[t.value],n=i.value;return typeof r==typeof n&&r<=n}],"filter-id-<=":[en,[nn],(e,[t])=>{const i=e.id(),r=t.value;return typeof i==typeof r&&i<=r}],"filter->=":[en,[Qr,nn],(e,[t,i])=>{const r=e.properties()[t.value],n=i.value;return typeof r==typeof n&&r>=n}],"filter-id->=":[en,[nn],(e,[t])=>{const i=e.id(),r=t.value;return typeof i==typeof r&&i>=r}],"filter-has":[en,[nn],(e,[t])=>t.value in e.properties()],"filter-has-id":[en,[],e=>null!==e.id()&&void 0!==e.id()],"filter-type-in":[en,[ln(Qr)],(e,[t])=>t.value.indexOf(e.geometryType())>=0],"filter-id-in":[en,[ln(nn)],(e,[t])=>t.value.indexOf(e.id())>=0],"filter-in-small":[en,[Qr,ln(nn)],(e,[t,i])=>i.value.indexOf(e.properties()[t.value])>=0],"filter-in-large":[en,[Qr,ln(nn)],(e,[t,i])=>(function(e,t,i,r){for(;i<=r;){const n=i+r>>1;if(t[n]===e)return!0;t[n]>e?r=n-1:i=n+1}return!1})(e.properties()[t.value],i.value,0,i.value.length-1)],all:{type:en,overloads:[[[en,en],(e,[t,i])=>t.evaluate(e)&&i.evaluate(e)],[Ws(en),(e,t)=>{for(const i of t)if(!i.evaluate(e))return!1;return!0}]]},any:{type:en,overloads:[[[en,en],(e,[t,i])=>t.evaluate(e)||i.evaluate(e)],[Ws(en),(e,t)=>{for(const i of t)if(i.evaluate(e))return!0;return!1}]]},"!":[en,[en],(e,[t])=>!t.evaluate(e)],"is-supported-script":[en,[Qr],(e,[t])=>{const i=e.globals&&e.globals.isSupportedScript;return!i||i(t.evaluate(e))}],upcase:[Qr,[Qr],(e,[t])=>t.evaluate(e).toUpperCase()],downcase:[Qr,[Qr],(e,[t])=>t.evaluate(e).toLowerCase()],concat:[Qr,Ws(nn),(e,t)=>t.map((t=>bn(t.evaluate(e)))).join("")],"resolved-locale":[Qr,[on],(e,[t])=>t.evaluate(e).resolvedLocale()],random:[Kr,[Kr,Kr,nn],(e,t)=>{const[i,r,n]=t.map((t=>t.evaluate(e)));if(i>r)return i;if(i===r)return i;let o;if("string"==typeof n)o=(function(e){let t=0;if(0===e.length)return t;for(let i=0;iJSON.stringify(e))).join(", ")}, but found ${JSON.stringify(e)} instead.`);return e}catch(e){return this._warningHistory[e.message]||(this._warningHistory[e.message]=!0,"undefined"!=typeof console&&console.warn(`Failed to evaluate expression "${JSON.stringify(this.expression.serialize())}". ${e.message}`)),this._defaultValue}}}function ha(e){return Array.isArray(e)&&e.length>0&&"string"==typeof e[0]&&e[0]in js}function ua(e,t,i,r){const n=new Ko(js,[],t?(function(e){const t={color:tn,string:Qr,number:Kr,enum:Qr,boolean:en,formatted:sn,resolvedImage:an};return"array"===e.type?ln(t[e.value]||nn,e.length):t[e.type]})(t):void 0,void 0,void 0,i,r),o=n.parse(e,void 0,void 0,void 0,t&&"string"===t.type?{typeAnnotation:"coerce"}:void 0);return o?Hs(new ca(o,t,i,r)):Xs(n.errors)}class da{constructor(e,t,i){this.kind=e,this._styleExpression=t,this.isLightConstant=i,this.isStateDependent="constant"!==e&&!Wo(t.expression),this.configDependencies=Ho(t.expression)}evaluateWithoutErrorHandling(e,t,i,r,n,o){return this._styleExpression.evaluateWithoutErrorHandling(e,t,i,r,n,o)}evaluate(e,t,i,r,n,o){return this._styleExpression.evaluate(e,t,i,r,n,o)}}class pa{constructor(e,t,i,r,n){this.kind=e,this.zoomStops=i,this._styleExpression=t,this.isStateDependent="camera"!==e&&!Wo(t.expression),this.isLightConstant=n,this.configDependencies=Ho(t.expression),this.interpolationType=r}evaluateWithoutErrorHandling(e,t,i,r,n,o){return this._styleExpression.evaluateWithoutErrorHandling(e,t,i,r,n,o)}evaluate(e,t,i,r,n,o){return this._styleExpression.evaluate(e,t,i,r,n,o)}interpolationFactor(e,t,i){return this.interpolationType?vs.interpolationFactor(this.interpolationType,e,t,i):0}}function fa(e,t,i,r){if("error"===(e=ua(e,t,i,r)).result)return e;const n=e.value.expression,o=Zo(n);if(!o&&!Js(t))return Xs([new Xr("","data expressions not supported")]);const s=Xo(n,["zoom","pitch","distance-from-center"]);if(!s&&!Qs(t))return Xs([new Xr("","zoom expressions not supported")]);const a=Xo(n,["measure-light"]);if(!a&&!Ks(t))return Xs([new Xr("","measure-light expression not supported")]);const l=t.expression&&t.expression.relaxZoomRestriction,c=_a(n);return c||s||l?c instanceof Xr?Xs([c]):c instanceof vs&&!ea(t)?Xs([new Xr("",'"interpolate" expressions cannot be used with this property')]):Hs(c?new pa(o?"camera":"composite",e.value,c.labels,c instanceof vs?c.interpolation:void 0,a):new da(o?"constant":"source",e.value,a)):Xs([new Xr("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression, or in the properties of atmosphere.')])}class ma{constructor(e,t){this._parameters=e,this._specification=t,Hr(this,ra(this._parameters,this._specification))}static deserialize(e){return new ma(e._parameters,e._specification)}static serialize(e){return{_parameters:e._parameters,_specification:e._specification}}}function _a(e){let t=null;if(e instanceof Ts)t=_a(e.result);else if(e instanceof ws){for(const i of e.args)if(t=_a(i),t)break}else(e instanceof ts||e instanceof vs)&&e.input instanceof Rn&&"zoom"===e.input.name&&(t=e);return t instanceof Xr||e.eachChild((e=>{const i=_a(e);i instanceof Xr?t=i:t&&i&&t!==i&&(t=new Xr("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))})),t}var ga=xa,ya=3;function xa(e,t,i){var r=this.cells=[];if(e instanceof ArrayBuffer){this.arrayBuffer=e;var n=new Int32Array(this.arrayBuffer);e=n[0],this.d=(t=n[1])+2*(i=n[2]);for(var o=0;o=h[p+0]&&r>=h[p+1])?(s[d]=!0,o.push(c[d])):s[d]=!1}}},xa.prototype._forEachCell=function(e,t,i,r,n,o,s,a){for(var l=this._convertToCellCoord(e),c=this._convertToCellCoord(t),h=this._convertToCellCoord(i),u=this._convertToCellCoord(r),d=l;d<=h;d++)for(var p=c;p<=u;p++){var f=this.d*p+d;if((!a||a(this._convertFromCellCoord(d),this._convertFromCellCoord(p),this._convertFromCellCoord(d+1),this._convertFromCellCoord(p+1)))&&n.call(this,e,t,i,r,f,o,s,a))return}},xa.prototype._convertFromCellCoord=function(e){return(e-this.padding)/this.scale},xa.prototype._convertToCellCoord=function(e){return Math.max(0,Math.min(this.d-1,Math.floor(e*this.scale)+this.padding))},xa.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var e=this.cells,t=ya+this.cells.length+1+1,i=0,r=0;r=0||(n[i]=Sa(e[i],t)));e instanceof Error&&(n.message=e.message)}if(n.$name)throw new Error("$name property is reserved for worker serialization logic.");return"Object"!==r&&(n.$name=r),n}throw new Error("can't serialize object of type "+typeof e)}function Ma(e){if(null==e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||e instanceof Boolean||e instanceof Number||e instanceof String||e instanceof Date||e instanceof RegExp||Ta(e)||Ea(e)||ArrayBuffer.isView(e)||e instanceof ImageData)return e;if(Array.isArray(e))return e.map(Ma);if("object"==typeof e){const t=e.$name||"Object";if("Map"===t){const t=new Map;for(const i of Object.keys(e))"$name"!==i&&t.set(i,Ma(e[i]));return t}if("Set"===t){const t=new Set;for(const i of Object.keys(e))"$name"!==i&&t.add(Ma(e[i]));return t}const{klass:i}=ba[t];if(!i)throw new Error(`can't deserialize unregistered class ${t}`);if(i.deserialize)return i.deserialize(e);const r=Object.create(i.prototype);for(const t of Object.keys(e))"$name"!==t&&(r[t]=Ma(e[t]));return r}throw new Error("can't deserialize object of type "+typeof e)}const Aa={"Latin-1 Supplement":e=>e>=128&&e<=255,Arabic:e=>e>=1536&&e<=1791,"Arabic Supplement":e=>e>=1872&&e<=1919,"Arabic Extended-A":e=>e>=2208&&e<=2303,"Hangul Jamo":e=>e>=4352&&e<=4607,"Unified Canadian Aboriginal Syllabics":e=>e>=5120&&e<=5759,Khmer:e=>e>=6016&&e<=6143,"Unified Canadian Aboriginal Syllabics Extended":e=>e>=6320&&e<=6399,"General Punctuation":e=>e>=8192&&e<=8303,"Letterlike Symbols":e=>e>=8448&&e<=8527,"Number Forms":e=>e>=8528&&e<=8591,"Miscellaneous Technical":e=>e>=8960&&e<=9215,"Control Pictures":e=>e>=9216&&e<=9279,"Optical Character Recognition":e=>e>=9280&&e<=9311,"Enclosed Alphanumerics":e=>e>=9312&&e<=9471,"Geometric Shapes":e=>e>=9632&&e<=9727,"Miscellaneous Symbols":e=>e>=9728&&e<=9983,"Miscellaneous Symbols and Arrows":e=>e>=11008&&e<=11263,"CJK Radicals Supplement":e=>e>=11904&&e<=12031,"Kangxi Radicals":e=>e>=12032&&e<=12255,"Ideographic Description Characters":e=>e>=12272&&e<=12287,"CJK Symbols and Punctuation":e=>e>=12288&&e<=12351,Hiragana:e=>e>=12352&&e<=12447,Katakana:e=>e>=12448&&e<=12543,Bopomofo:e=>e>=12544&&e<=12591,"Hangul Compatibility Jamo":e=>e>=12592&&e<=12687,Kanbun:e=>e>=12688&&e<=12703,"Bopomofo Extended":e=>e>=12704&&e<=12735,"CJK Strokes":e=>e>=12736&&e<=12783,"Katakana Phonetic Extensions":e=>e>=12784&&e<=12799,"Enclosed CJK Letters and Months":e=>e>=12800&&e<=13055,"CJK Compatibility":e=>e>=13056&&e<=13311,"CJK Unified Ideographs Extension A":e=>e>=13312&&e<=19903,"Yijing Hexagram Symbols":e=>e>=19904&&e<=19967,"CJK Unified Ideographs":e=>e>=19968&&e<=40959,"Yi Syllables":e=>e>=40960&&e<=42127,"Yi Radicals":e=>e>=42128&&e<=42191,"Hangul Jamo Extended-A":e=>e>=43360&&e<=43391,"Hangul Syllables":e=>e>=44032&&e<=55215,"Hangul Jamo Extended-B":e=>e>=55216&&e<=55295,"Private Use Area":e=>e>=57344&&e<=63743,"CJK Compatibility Ideographs":e=>e>=63744&&e<=64255,"Arabic Presentation Forms-A":e=>e>=64336&&e<=65023,"Vertical Forms":e=>e>=65040&&e<=65055,"CJK Compatibility Forms":e=>e>=65072&&e<=65103,"Small Form Variants":e=>e>=65104&&e<=65135,"Arabic Presentation Forms-B":e=>e>=65136&&e<=65279,"Halfwidth and Fullwidth Forms":e=>e>=65280&&e<=65519,"CJK Unified Ideographs Extension B":e=>e>=131072&&e<=173791};function Ia(e){for(const t of e)if(za(t.charCodeAt(0)))return!0;return!1}function Ca(e){for(const t of e)if(!Pa(t.charCodeAt(0)))return!1;return!0}function Pa(e){return!(Aa.Arabic(e)||Aa["Arabic Supplement"](e)||Aa["Arabic Extended-A"](e)||Aa["Arabic Presentation Forms-A"](e)||Aa["Arabic Presentation Forms-B"](e))}function za(e){return!(746!==e&&747!==e&&(e<4352||!(Aa["Bopomofo Extended"](e)||Aa.Bopomofo(e)||Aa["CJK Compatibility Forms"](e)&&!(e>=65097&&e<=65103)||Aa["CJK Compatibility Ideographs"](e)||Aa["CJK Compatibility"](e)||Aa["CJK Radicals Supplement"](e)||Aa["CJK Strokes"](e)||!(!Aa["CJK Symbols and Punctuation"](e)||e>=12296&&e<=12305||e>=12308&&e<=12319||12336===e)||Aa["CJK Unified Ideographs Extension A"](e)||Aa["CJK Unified Ideographs"](e)||Aa["Enclosed CJK Letters and Months"](e)||Aa["Hangul Compatibility Jamo"](e)||Aa["Hangul Jamo Extended-A"](e)||Aa["Hangul Jamo Extended-B"](e)||Aa["Hangul Jamo"](e)||Aa["Hangul Syllables"](e)||Aa.Hiragana(e)||Aa["Ideographic Description Characters"](e)||Aa.Kanbun(e)||Aa["Kangxi Radicals"](e)||Aa["Katakana Phonetic Extensions"](e)||Aa.Katakana(e)&&12540!==e||!(!Aa["Halfwidth and Fullwidth Forms"](e)||65288===e||65289===e||65293===e||e>=65306&&e<=65310||65339===e||65341===e||65343===e||e>=65371&&e<=65503||65507===e||e>=65512&&e<=65519)||!(!Aa["Small Form Variants"](e)||e>=65112&&e<=65118||e>=65123&&e<=65126)||Aa["Unified Canadian Aboriginal Syllabics"](e)||Aa["Unified Canadian Aboriginal Syllabics Extended"](e)||Aa["Vertical Forms"](e)||Aa["Yijing Hexagram Symbols"](e)||Aa["Yi Syllables"](e)||Aa["Yi Radicals"](e))))}function Da(e){return!(za(e)||(function(e){return!!(Aa["Latin-1 Supplement"](e)&&(167===e||169===e||174===e||177===e||188===e||189===e||190===e||215===e||247===e)||Aa["General Punctuation"](e)&&(8214===e||8224===e||8225===e||8240===e||8241===e||8251===e||8252===e||8258===e||8263===e||8264===e||8265===e||8273===e)||Aa["Letterlike Symbols"](e)||Aa["Number Forms"](e)||Aa["Miscellaneous Technical"](e)&&(e>=8960&&e<=8967||e>=8972&&e<=8991||e>=8996&&e<=9e3||9003===e||e>=9085&&e<=9114||e>=9150&&e<=9165||9167===e||e>=9169&&e<=9179||e>=9186&&e<=9215)||Aa["Control Pictures"](e)&&9251!==e||Aa["Optical Character Recognition"](e)||Aa["Enclosed Alphanumerics"](e)||Aa["Geometric Shapes"](e)||Aa["Miscellaneous Symbols"](e)&&!(e>=9754&&e<=9759)||Aa["Miscellaneous Symbols and Arrows"](e)&&(e>=11026&&e<=11055||e>=11088&&e<=11097||e>=11192&&e<=11243)||Aa["CJK Symbols and Punctuation"](e)||Aa.Katakana(e)||Aa["Private Use Area"](e)||Aa["CJK Compatibility Forms"](e)||Aa["Small Form Variants"](e)||Aa["Halfwidth and Fullwidth Forms"](e)||8734===e||8756===e||8757===e||e>=9984&&e<=10087||e>=10102&&e<=10131||65532===e||65533===e)})(e))}function Ra(e){return e>=1424&&e<=2303||Aa["Arabic Presentation Forms-A"](e)||Aa["Arabic Presentation Forms-B"](e)}function La(e,t){return!(!t&&Ra(e)||e>=2304&&e<=3583||e>=3840&&e<=4255||Aa.Khmer(e))}function ka(e){for(const t of e)if(Ra(t.charCodeAt(0)))return!0;return!1}const Oa="deferred",Ba="loading",Fa="loaded";let Na=null,Va="unavailable",Ua=null;const ja=function(e){e&&"string"==typeof e&&e.indexOf("NetworkError")>-1&&(Va="error"),Na&&Na(e)};function $a(){Ga.fire(new Rr("pluginStateChange",{pluginStatus:Va,pluginURL:Ua}))}const Ga=new Br,qa=function(){return Va},Za=function(){if(Va!==Oa||!Ua)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");Va=Ba,$a(),Ua&&rr({url:Ua},(e=>{e?ja(e):(Va=Fa,$a())}))},Wa={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:()=>Va===Fa||null!=Wa.applyArabicShaping,isLoading:()=>Va===Ba,setState(e){Va=e.pluginStatus,Ua=e.pluginURL},isParsed:()=>null!=Wa.applyArabicShaping&&null!=Wa.processBidirectionalText&&null!=Wa.processStyledBidirectionalText,getPluginURL:()=>Ua};class Ha{constructor(e,t){this.zoom=e,t?(this.now=t.now,this.fadeDuration=t.fadeDuration,this.transition=t.transition,this.pitch=t.pitch,this.brightness=t.brightness):(this.now=0,this.fadeDuration=0,this.transition={},this.pitch=0,this.brightness=0)}isSupportedScript(e){return(function(e,t){for(const i of e)if(!La(i.charCodeAt(0),t))return!1;return!0})(e,Wa.isLoaded())}}class Xa{constructor(e,t,i,r){this.property=e,this.value=t,this.expression=(function(e,t,i,r){if(ta(e))return new ma(e,t);if(ha(e)||Array.isArray(e)&&e.length>0){const n=fa(e,t,i,r);if("error"===n.result)throw new Error(n.value.map((e=>`${e.key}: ${e.message}`)).join(", "));return n.value}{let i=e;return"string"==typeof e&&"color"===t.type&&(i=$r.parse(e)),{kind:"constant",configDependencies:new Set,evaluate:()=>i}}})(void 0===t?e.specification.default:t,e.specification,i,r)}isDataDriven(){return"source"===this.expression.kind||"composite"===this.expression.kind}possiblyEvaluate(e,t,i){return this.property.possiblyEvaluate(this,e,t,i)}}class Ya{constructor(e,t,i){this.property=e,this.value=new Xa(e,void 0,t,i)}transitioned(e,t){return new Ka(this.property,this.value,t,ii({},e.transition,this.transition),e.now)}untransitioned(){return new Ka(this.property,this.value,null,{},0)}}class Ja{constructor(e,t,i){this._properties=e,this._values=Object.create(e.defaultTransitionablePropertyValues),this._scope=t,this._options=i,this.configDependencies=new Set}getValue(e){return di(this._values[e].value.value)}setValue(e,t){this._values.hasOwnProperty(e)||(this._values[e]=new Ya(this._values[e].property,this._scope,this._options)),this._values[e].value=new Xa(this._values[e].property,null===t?void 0:di(t),this._scope,this._options),this._values[e].value.expression.configDependencies&&(this.configDependencies=new Set([...this.configDependencies,...this._values[e].value.expression.configDependencies]))}setTransitionOrValue(e,t){t&&(this._options=t);const i=this._properties.properties;if(e)for(const t in e){const r=e[t];if(ci(t,"-transition")){const e=t.slice(0,-11);i[e]&&this.setTransition(e,r)}else i.hasOwnProperty(t)&&this.setValue(t,r)}}getTransition(e){return di(this._values[e].transition)}setTransition(e,t){this._values.hasOwnProperty(e)||(this._values[e]=new Ya(this._values[e].property)),this._values[e].transition=di(t)||void 0}serialize(){const e={};for(const t of Object.keys(this._values)){const i=this.getValue(t);void 0!==i&&(e[t]=i);const r=this.getTransition(t);void 0!==r&&(e[`${t}-transition`]=r)}return e}transitioned(e,t){const i=new Qa(this._properties);for(const r of Object.keys(this._values))i._values[r]=this._values[r].transitioned(e,t._values[r]);return i}untransitioned(){const e=new Qa(this._properties);for(const t of Object.keys(this._values))e._values[t]=this._values[t].untransitioned();return e}}class Ka{constructor(e,t,i,r,n){const o=r.delay||0,s=r.duration||0;n=n||0,this.property=e,this.value=t,this.begin=n+o,this.end=this.begin+s,e.specification.transition&&(r.delay||r.duration)&&(this.prior=i)}possiblyEvaluate(e,t,i){const r=e.now||0,n=this.value.possiblyEvaluate(e,t,i),o=this.prior;if(o){if(r>this.end)return this.prior=null,n;if(this.value.isDataDriven())return this.prior=null,n;if(r":1,">=":1,"<":1,"<=":1,"in":1,"!in":1,"all":1,"any":1,"none":1,"has":1,"!has":1}},"geometry_type":{"type":"enum","values":{"Point":1,"LineString":1,"Polygon":1}},"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":1,"exponential":1,"interval":1,"categorical":1},"default":"exponential"},"colorSpace":{"type":"enum","values":{"rgb":1,"lab":1,"hcl":1},"default":"rgb"},"default":{"type":"*","required":false}},"function_stop":{"type":"array","minimum":0,"maximum":24,"value":["number","color"],"length":2},"expression":{"type":"array","value":"*","minimum":1},"fog":{"range":{"type":"array","default":[0.5,10],"minimum":-20,"maximum":20,"length":2,"value":"number","property-type":"data-constant","transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true}},"color":{"type":"color","property-type":"data-constant","default":"#ffffff","expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"high-color":{"type":"color","property-type":"data-constant","default":"#245cdf","expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"space-color":{"type":"color","property-type":"data-constant","default":["interpolate",["linear"],["zoom"],4,"#010b19",7,"#367ab9"],"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"horizon-blend":{"type":"number","property-type":"data-constant","default":["interpolate",["linear"],["zoom"],4,0.2,7,0.1],"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"star-intensity":{"type":"number","property-type":"data-constant","default":["interpolate",["linear"],["zoom"],5,0.35,6,0],"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true},"transition":true},"vertical-range":{"type":"array","default":[0,0],"minimum":0,"length":2,"value":"number","property-type":"data-constant","transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"],"relaxZoomRestriction":true}}},"camera":{"camera-projection":{"type":"enum","values":{"perspective":1,"orthographic":1},"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"default":"perspective","property-type":"data-constant"}},"colorTheme":{"data":{"type":"string","property-type":"data-constant","expression":{}}},"light":{"anchor":{"type":"enum","default":"viewport","values":{"map":1,"viewport":1},"property-type":"data-constant","expression":{"parameters":["zoom"]}},"position":{"type":"array","default":[1.15,210,30],"length":3,"value":"number","property-type":"data-constant","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"color":{"type":"color","property-type":"data-constant","default":"#ffffff","expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"intensity":{"type":"number","property-type":"data-constant","default":0.5,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true}},"projection":{"name":{"type":"enum","values":{"albers":1,"equalEarth":1,"equirectangular":1,"lambertConformalConic":1,"mercator":1,"naturalEarth":1,"winkelTripel":1,"globe":1},"default":"mercator","required":true},"center":{"type":"array","length":2,"value":"number","property-type":"data-constant","minimum":[-180,-90],"maximum":[180,90]},"parallels":{"type":"array","length":2,"value":"number","property-type":"data-constant","minimum":[-90,-90],"maximum":[90,90]}},"terrain":{"source":{"type":"string","required":true},"exaggeration":{"type":"number","property-type":"data-constant","default":1,"minimum":0,"maximum":1000,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true}},"paint":["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_raster-particle","paint_hillshade","paint_background","paint_sky","paint_model"],"paint_fill":{"fill-antialias":{"type":"boolean","default":true,"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"fill-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"fill-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"fill-outline-color":{"type":"color","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"fill-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{"type":"enum","values":{"map":1,"viewport":1},"default":"map","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"fill-pattern":{"type":"resolvedImage","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"fill-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"fill-extrusion-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{"type":"enum","values":{"map":1,"viewport":1},"default":"map","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{"type":"resolvedImage","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"fill-extrusion-height":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{"type":"boolean","default":true,"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"fill-extrusion-ambient-occlusion-intensity":{"property-type":"data-constant","type":"number","private":true,"default":0,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"fill-extrusion-ambient-occlusion-radius":{"property-type":"data-constant","type":"number","private":true,"default":3,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"fill-extrusion-ambient-occlusion-wall-radius":{"property-type":"data-constant","type":"number","experimental":true,"default":3,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"fill-extrusion-ambient-occlusion-ground-radius":{"property-type":"data-constant","type":"number","experimental":true,"default":3,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true},"fill-extrusion-ambient-occlusion-ground-attenuation":{"property-type":"data-constant","type":"number","experimental":true,"default":0.69,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"fill-extrusion-flood-light-color":{"property-type":"data-constant","type":"color","experimental":true,"default":"#ffffff","transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]}},"fill-extrusion-flood-light-intensity":{"property-type":"data-constant","type":"number","experimental":true,"default":0,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]}},"fill-extrusion-flood-light-wall-radius":{"property-type":"data-driven","type":"number","experimental":true,"default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["feature","feature-state"]}},"fill-extrusion-flood-light-ground-radius":{"property-type":"data-driven","type":"number","experimental":true,"default":0,"transition":true,"expression":{"interpolated":true,"parameters":["feature","feature-state"]}},"fill-extrusion-flood-light-ground-attenuation":{"property-type":"data-constant","type":"number","experimental":true,"default":0.69,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"fill-extrusion-vertical-scale":{"property-type":"data-constant","type":"number","experimental":true,"default":1,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"fill-extrusion-rounded-roof":{"property-type":"data-constant","type":"boolean","default":true,"experimental":true,"expression":{"parameters":["zoom"]}},"fill-extrusion-cutoff-fade-range":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{},"property-type":"data-constant"},"fill-extrusion-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"},"fill-extrusion-line-width":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"fill-extrusion-line-alignment":{"type":"enum","values":{"inside":1,"outside":1,"center":1},"default":"center","property-type":"data-constant"}},"paint_line":{"line-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"line-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"line-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{"type":"enum","values":{"map":1,"viewport":1},"default":"map","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"line-width":{"type":"number","default":1,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"line-gap-width":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"line-offset":{"type":"number","default":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"line-blur":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"line-dasharray":{"type":"array","value":"number","minimum":0,"expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-pattern":{"type":"resolvedImage","expression":{"parameters":["zoom","feature"]},"property-type":"data-driven"},"line-gradient":{"type":"color","expression":{"interpolated":true,"parameters":["line-progress"]},"property-type":"color-ramp"},"line-trim-offset":{"type":"array","value":"number","length":2,"default":[0,0],"minimum":[0,0],"maximum":[1,1],"property-type":"constant"},"line-trim-fade-range":{"type":"array","value":"number","experimental":true,"length":2,"default":[0,0],"minimum":[0,0],"maximum":[1,1],"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"},"line-trim-color":{"type":"color","experimental":true,"default":"transparent","transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"},"line-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"},"line-border-width":{"type":"number","private":true,"default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-border-color":{"type":"color","private":true,"default":"rgba(0, 0, 0, 0)","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-occlusion-opacity":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true,"property-type":"data-constant"}},"paint_circle":{"circle-radius":{"type":"number","default":5,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-blur":{"type":"number","default":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{"type":"enum","values":{"map":1,"viewport":1},"default":"map","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{"type":"enum","values":{"map":1,"viewport":1},"default":"map","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{"type":"enum","values":{"map":1,"viewport":1},"default":"viewport","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-stroke-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-stroke-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"circle-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"}},"paint_heatmap":{"heatmap-radius":{"type":"number","default":30,"minimum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"heatmap-weight":{"type":"number","default":1,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"heatmap-intensity":{"type":"number","default":1,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"heatmap-color":{"type":"color","default":["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",0.1,"royalblue",0.3,"cyan",0.5,"lime",0.7,"yellow",1,"red"],"expression":{"interpolated":true,"parameters":["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_symbol":{"icon-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-occlusion-opacity":{"type":"number","minimum":0,"maximum":1,"default":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-emissive-strength":{"type":"number","default":1,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-driven"},"text-emissive-strength":{"type":"number","default":1,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-driven"},"icon-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-halo-color":{"type":"color","default":"rgba(0, 0, 0, 0)","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-halo-width":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-halo-blur":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"icon-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{"type":"enum","values":{"map":1,"viewport":1},"default":"map","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"icon-image-cross-fade":{"type":"number","property-type":"data-driven","default":0,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"transition":true},"text-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-occlusion-opacity":{"type":"number","minimum":0,"maximum":1,"default":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-color":{"type":"color","default":"#000000","transition":true,"overridable":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-halo-color":{"type":"color","default":"rgba(0, 0, 0, 0)","transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-halo-width":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-halo-blur":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","feature","feature-state","measure-light"]},"property-type":"data-driven"},"text-translate":{"type":"array","value":"number","length":2,"default":[0,0],"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{"type":"enum","values":{"map":1,"viewport":1},"default":"map","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"icon-color-saturation":{"type":"number","default":0,"minimum":-1,"maximum":1,"expression":{},"property-type":"data-constant"},"icon-color-contrast":{"type":"number","default":0,"minimum":-1,"maximum":1,"expression":{},"property-type":"data-constant"},"icon-color-brightness-min":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{},"property-type":"data-constant"},"icon-color-brightness-max":{"type":"number","default":1,"minimum":0,"maximum":1,"expression":{},"property-type":"data-constant"}},"paint_raster":{"raster-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-color":{"type":"color","expression":{"interpolated":true,"parameters":["raster-value"]},"property-type":"color-ramp"},"raster-color-mix":{"type":"array","default":[0.2126,0.7152,0.0722,0],"length":4,"value":"number","property-type":"data-constant","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"raster-color-range":{"type":"array","length":2,"value":"number","property-type":"data-constant","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]}},"raster-hue-rotate":{"type":"number","default":0,"period":360,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{"type":"number","default":0,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-saturation":{"type":"number","default":0,"minimum":-1,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-contrast":{"type":"number","default":0,"minimum":-1,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-resampling":{"type":"enum","values":{"linear":1,"nearest":1},"default":"linear","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{"type":"number","default":300,"minimum":0,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"},"raster-array-band":{"type":"string","required":false,"experimental":true,"property-type":"data-constant"},"raster-elevation":{"type":"number","default":0,"minimum":0,"transition":true,"experimental":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_raster-particle":{"raster-particle-array-band":{"type":"string","required":false,"property-type":"data-constant"},"raster-particle-count":{"type":"number","default":512,"minimum":1,"property-type":"data-constant"},"raster-particle-color":{"type":"color","expression":{"interpolated":true,"parameters":["raster-particle-speed"]},"property-type":"color-ramp"},"raster-particle-max-speed":{"type":"number","default":1,"minimum":1,"property-type":"data-constant"},"raster-particle-speed-factor":{"type":"number","default":0.2,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-particle-fade-opacity-factor":{"type":"number","default":0.98,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"raster-particle-reset-rate-factor":{"type":"number","default":0.8,"minimum":0,"maximum":1,"property-type":"data-constant"},"raster-particle-elevation":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_hillshade":{"hillshade-illumination-direction":{"type":"number","default":335,"minimum":0,"maximum":359,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{"type":"enum","values":{"map":1,"viewport":1},"default":"viewport","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{"type":"number","default":0.5,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"},"hillshade-highlight-color":{"type":"color","default":"#FFFFFF","transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"},"hillshade-accent-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"},"hillshade-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"}},"paint_background":{"background-color":{"type":"color","default":"#000000","transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"background-pattern":{"type":"resolvedImage","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"background-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"background-emissive-strength":{"type":"number","default":0,"minimum":0,"transition":true,"expression":{"interpolated":true,"parameters":["zoom","measure-light"]},"property-type":"data-constant"}},"paint_sky":{"sky-type":{"type":"enum","values":{"gradient":1,"atmosphere":1},"default":"atmosphere","expression":{"parameters":["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun":{"type":"array","value":"number","length":2,"minimum":[0,0],"maximum":[360,180],"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun-intensity":{"type":"number","default":10,"minimum":0,"maximum":100,"property-type":"data-constant"},"sky-gradient-center":{"type":"array","value":"number","default":[0,0],"length":2,"minimum":[0,0],"maximum":[360,180],"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"sky-gradient-radius":{"type":"number","default":90,"minimum":0,"maximum":180,"expression":{"parameters":["zoom"]},"property-type":"data-constant"},"sky-gradient":{"type":"color","default":["interpolate",["linear"],["sky-radial-progress"],0.8,"#87ceeb",1,"white"],"expression":{"interpolated":true,"parameters":["sky-radial-progress"]},"property-type":"color-ramp"},"sky-atmosphere-halo-color":{"type":"color","default":"white","property-type":"data-constant"},"sky-atmosphere-color":{"type":"color","default":"white","property-type":"data-constant"},"sky-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"}},"paint_model":{"model-opacity":{"type":"number","default":1,"minimum":0,"maximum":1,"transition":true,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant"},"model-rotation":{"type":"array","value":"number","length":3,"default":[0,0,0],"period":360,"property-type":"data-driven","expression":{"interpolated":true,"parameters":["feature","feature-state","zoom"]},"transition":true},"model-scale":{"type":"array","value":"number","length":3,"default":[1,1,1],"property-type":"data-driven","expression":{"interpolated":true,"parameters":["feature","feature-state","zoom"]},"transition":true},"model-translation":{"type":"array","value":"number","length":3,"default":[0,0,0],"property-type":"data-driven","expression":{"interpolated":true,"parameters":["feature","feature-state","zoom"]},"transition":true},"model-color":{"type":"color","default":"#ffffff","property-type":"data-driven","expression":{"interpolated":true,"parameters":["feature","feature-state","measure-light","zoom"]},"transition":true},"model-color-mix-intensity":{"type":"number","property-type":"data-driven","default":0,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["feature","feature-state","measure-light"]},"transition":true},"model-type":{"type":"enum","values":{"common-3d":1,"location-indicator":1},"default":"common-3d","property-type":"data-constant"},"model-cast-shadows":{"type":"boolean","default":true,"property-type":"data-constant"},"model-receive-shadows":{"type":"boolean","default":true,"property-type":"data-constant"},"model-ambient-occlusion-intensity":{"type":"number","default":1,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"property-type":"data-constant","transition":true},"model-emissive-strength":{"type":"number","property-type":"data-driven","default":0,"minimum":0,"maximum":5,"expression":{"interpolated":true,"parameters":["feature","feature-state","measure-light"]},"transition":true},"model-roughness":{"type":"number","default":1,"minimum":0,"maximum":1,"property-type":"data-driven","expression":{"interpolated":true,"parameters":["feature","feature-state"]},"transition":true},"model-height-based-emissive-strength-multiplier":{"type":"array","default":[1,1,1,1,0],"length":5,"value":"number","property-type":"data-driven","expression":{"interpolated":true,"parameters":["feature","feature-state","measure-light"]},"transition":true},"model-cutoff-fade-range":{"type":"number","default":0,"minimum":0,"maximum":1,"expression":{},"property-type":"data-constant"},"model-front-cutoff":{"type":"array","private":true,"value":"number","property-type":"data-constant","expression":{"interpolated":true,"parameters":["zoom"]},"length":3,"default":[0,0,1],"minimum":[0,0,0],"maximum":[1,1,1]}},"transition":{"duration":{"type":"number","default":300,"minimum":0},"delay":{"type":"number","default":0,"minimum":0}},"property-type":{"data-driven":{"type":"property-type"},"color-ramp":{"type":"property-type"},"data-constant":{"type":"property-type"},"constant":{"type":"property-type"}},"promoteId":{"*":{"type":"string"}}}');function ll(e){return e instanceof Number||e instanceof String||e instanceof Boolean?e.valueOf():e}function cl(e){if(Array.isArray(e))return e.map(cl);if(e instanceof Object&&!(e instanceof Number||e instanceof String||e instanceof Boolean)){const t={};for(const i in e)t[i]=cl(e[i]);return t}return ll(e)}function hl(e){if(!0===e||!1===e)return!0;if(!Array.isArray(e)||0===e.length)return!1;switch(e[0]){case"has":return e.length>=2&&"$id"!==e[1]&&"$type"!==e[1];case"in":return e.length>=3&&("string"!=typeof e[1]||Array.isArray(e[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==e.length||Array.isArray(e[1])||Array.isArray(e[2]);case"any":case"all":for(const t of e.slice(1))if(!hl(t)&&"boolean"!=typeof t)return!1;return!0;default:return!0}}function ul(e,t="fill"){if(null==e)return{filter:()=>!0,needGeometry:!1,needFeature:!1};hl(e)||(e=yl(e));const i=e;let r=!0;try{r=(function(e){if(!fl(e))return e;let t=cl(e);return pl(t),t=dl(t),t})(i)}catch(e){console.warn(`Failed to extract static filter. Filter will continue working, but at higher memory usage and slower framerate.\nThis is most likely a bug, please report this via https://github.com/mapbox/mapbox-gl-js/issues/new?assignees=&labels=&template=Bug_report.md\nand paste the contents of this message in the report.\nThank you!\nFilter Expression:\n${JSON.stringify(i,null,2)}\n `)}const n=al[`filter_${t}`],o=ua(r,n);let s=null;if("error"===o.result)throw new Error(o.value.map((e=>`${e.key}: ${e.message}`)).join(", "));s=(e,t,i)=>o.value.evaluate(e,t,{},i);let a=null,l=null;if(r!==i){const e=ua(i,n);if("error"===e.result)throw new Error(e.value.map((e=>`${e.key}: ${e.message}`)).join(", "));a=(t,i,r,n,o)=>e.value.evaluate(t,i,{},r,void 0,void 0,n,o),l=!Zo(e.value.expression)}return{filter:s,dynamicFilter:a||void 0,needGeometry:gl(r),needFeature:!!l}}function dl(e){if(!Array.isArray(e))return e;const t=(function(e){if(ml.has(e[0]))for(let t=1;tdl(e)))}function pl(e){let t=!1;const i=[];if("case"===e[0]){for(let r=1;r",">=","<","<=","to-boolean"]);function _l(e,t){return et?1:0}function gl(e){if(!Array.isArray(e))return!1;if("within"===e[0]||"distance"===e[0])return!0;for(let t=1;t"===t||"<="===t||">="===t?xl(e[1],e[2],t):"any"===t?(i=e.slice(1),["any"].concat(i.map(yl))):"all"===t?["all"].concat(e.slice(1).map(yl)):"none"===t?["all"].concat(e.slice(1).map(yl).map(wl)):"in"===t?vl(e[1],e.slice(2)):"!in"===t?wl(vl(e[1],e.slice(2))):"has"===t?bl(e[1]):"!has"!==t||wl(bl(e[1]));var i}function xl(e,t,i){switch(e){case"$type":return[`filter-type-${i}`,t];case"$id":return[`filter-id-${i}`,t];default:return[`filter-${i}`,e,t]}}function vl(e,t){if(0===t.length)return!1;switch(e){case"$type":return["filter-type-in",["literal",t]];case"$id":return["filter-id-in",["literal",t]];default:return t.length>200&&!t.some((e=>typeof e!=typeof t[0]))?["filter-in-large",e,["literal",t.sort(_l)]]:["filter-in-small",e,["literal",t]]}}function bl(e){switch(e){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",e]}}function wl(e){return["!",e]}const Tl="\x1f";function El(e,t){return t?`${e}${Tl}${t}`:e}const Sl="-transition",Ml=new Set(["fill","line","background","hillshade","raster"]);class Al extends Br{constructor(e,t,i,r,n){if(super(),this.id=e.id,this.fqid=El(this.id,i),this.type=e.type,this.scope=i,this.lut=r,this.options=n,this._featureFilter={filter:()=>!0,needGeometry:!1,needFeature:!1},this._filterCompiled=!1,this.configDependencies=new Set,"custom"!==e.type&&(this.metadata=e.metadata,this.minzoom=e.minzoom,this.maxzoom=e.maxzoom,"background"!==e.type&&"sky"!==e.type&&"slot"!==e.type&&(this.source=e.source,this.sourceLayer=e["source-layer"],this.filter=e.filter),e.slot&&(this.slot=e.slot),t.layout&&(this._unevaluatedLayout=new el(t.layout,this.scope,n),this.configDependencies=new Set([...this.configDependencies,...this._unevaluatedLayout.configDependencies])),t.paint)){this._transitionablePaint=new Ja(t.paint,this.scope,n);for(const t in e.paint)this.setPaintProperty(t,e.paint[t]);for(const t in e.layout)this.setLayoutProperty(t,e.layout[t]);this.configDependencies=new Set([...this.configDependencies,...this._transitionablePaint.configDependencies]),this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new il(t.paint)}}onAdd(e){}onRemove(e){}isDraped(e){return Ml.has(this.type)}getLayoutProperty(e){return"visibility"===e?this.visibility:this._unevaluatedLayout.getValue(e)}setLayoutProperty(e,t){if("custom"===this.type&&"visibility"===e)return void(this.visibility=t);const i=this._unevaluatedLayout;i._properties.properties[e]&&(i.setValue(e,t),this.configDependencies=new Set([...this.configDependencies,...i.configDependencies]),"visibility"===e&&this.possiblyEvaluateVisibility())}possiblyEvaluateVisibility(){this.visibility=this._unevaluatedLayout._values.visibility.possiblyEvaluate({zoom:0})}getPaintProperty(e){return ci(e,Sl)?this._transitionablePaint.getTransition(e.slice(0,-11)):this._transitionablePaint.getValue(e)}setPaintProperty(e,t){const i=this._transitionablePaint,r=i._properties.properties;if(ci(e,Sl)){const n=e.slice(0,-11);return r[n]&&i.setTransition(n,t||void 0),!1}if(!r[e])return!1;const n=i._values[e],o=n.value.isDataDriven(),s=n.value;i.setValue(e,t),this.configDependencies=new Set([...this.configDependencies,...i.configDependencies]),this._handleSpecialPaintPropertyUpdate(e);const a=i._values[e].value,l=a.isDataDriven(),c=ci(e,"pattern")||"line-dasharray"===e;return l||o||c||this._handleOverridablePaintPropertyUpdate(e,s,a)}_handleSpecialPaintPropertyUpdate(e){}getProgramIds(){return null}getDefaultProgramParams(e,t,i){return null}_handleOverridablePaintPropertyUpdate(e,t,i){return!1}isHidden(e){return!!(this.minzoom&&e=this.maxzoom)||"none"===this.visibility}updateTransitions(e){this._transitioningPaint=this._transitionablePaint.transitioned(e,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(e,t){this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(e,void 0,t)),this.paint=this._transitioningPaint.possiblyEvaluate(e,void 0,t)}serialize(){return ui({id:this.id,type:this.type,slot:this.slot,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()},((e,t)=>!(void 0===e||"layout"===t&&!Object.keys(e).length||"paint"===t&&!Object.keys(e).length)))}is3D(){return!1}isSky(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}hasShadowPass(){return!1}canCastShadows(){return!1}hasLightBeamPass(){return!1}cutoffRange(){return 0}tileCoverLift(){return 0}resize(){}isStateDependent(){for(const e in this.paint._values){const t=this.paint.get(e);if(t instanceof tl&&Js(t.property.specification)&&("source"===t.value.kind||"composite"===t.value.kind)&&t.value.isStateDependent)return!0}return!1}compileFilter(){this._filterCompiled||(this._featureFilter=ul(this.filter),this._filterCompiled=!0)}invalidateCompiledFilter(){this._filterCompiled=!1}dynamicFilter(){return this._featureFilter.dynamicFilter}dynamicFilterNeedsFeature(){return this._featureFilter.needFeature}getLayerRenderingStats(){return this._stats}resetLayerRenderingStats(e){this._stats&&("shadow"===e.renderPass?this._stats.numRenderedVerticesInShadowPass=0:this._stats.numRenderedVerticesInTransparentPass=0)}queryRadius(e){}queryIntersectsFeature(e,t,i,r,n,o,s,a,l){}queryIntersectsMatchingFeature(e,t,i,r){}}const Il={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class Cl{constructor(e,t){this._structArray=e,this._pos1=t*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}class Pl{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(e,t){return e._trim(),t&&(e.isTransferred=!0,t.add(e.arrayBuffer)),{length:e.length,arrayBuffer:e.arrayBuffer}}static deserialize(e){const t=Object.create(this.prototype);return t.arrayBuffer=e.arrayBuffer,t.length=e.length,t.capacity=e.arrayBuffer.byteLength/t.bytesPerElement,t._refreshViews(),t}_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(e){this.reserve(e),this.length=e}reserve(e){if(e>this.capacity){this.capacity=Math.max(e,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);const t=this.uint8;this._refreshViews(),t&&this.uint8.set(t)}}_refreshViews(){throw new Error("StructArray#_refreshViews() must be implemented by each concrete StructArray layout")}emplace(...e){throw new Error("StructArray#emplace() must be implemented by each concrete StructArray layout")}emplaceBack(...e){throw new Error("StructArray#emplaceBack() must be implemented by each concrete StructArray layout")}destroy(){this.int8=this.uint8=this.int16=this.uint16=this.int32=this.uint32=this.float32=null,this.arrayBuffer=null}}function zl(e,t=1){let i=0,r=0;return{members:e.map((e=>{const n=Il[e.type].BYTES_PER_ELEMENT,o=i=Dl(i,Math.max(t,n)),s=e.components||1;return r=Math.max(r,n),i+=n*s,{name:e.name,type:e.type,components:s,offset:o}})),size:Dl(i,Math.max(r,t)),alignment:t}}function Dl(e,t){return Math.ceil(e/t)*t}class Rl extends Pl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t){const i=this.length;return this.resize(i+1),this.emplace(i,e,t)}emplace(e,t,i){const r=2*e;return this.int16[r+0]=t,this.int16[r+1]=i,e}}Rl.prototype.bytesPerElement=4,wa(Rl,"StructArrayLayout2i4");class Ll extends Pl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,i){const r=this.length;return this.resize(r+1),this.emplace(r,e,t,i)}emplace(e,t,i,r){const n=3*e;return this.int16[n+0]=t,this.int16[n+1]=i,this.int16[n+2]=r,e}}Ll.prototype.bytesPerElement=6,wa(Ll,"StructArrayLayout3i6");class kl extends Pl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,i,r){const n=this.length;return this.resize(n+1),this.emplace(n,e,t,i,r)}emplace(e,t,i,r,n){const o=4*e;return this.int16[o+0]=t,this.int16[o+1]=i,this.int16[o+2]=r,this.int16[o+3]=n,e}}kl.prototype.bytesPerElement=8,wa(kl,"StructArrayLayout4i8");class Ol extends Pl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,i,r,n){const o=this.length;return this.resize(o+1),this.emplace(o,e,t,i,r,n)}emplace(e,t,i,r,n,o){const s=5*e;return this.int16[s+0]=t,this.int16[s+1]=i,this.int16[s+2]=r,this.int16[s+3]=n,this.int16[s+4]=o,e}}Ol.prototype.bytesPerElement=10,wa(Ol,"StructArrayLayout5i10");class Bl extends Pl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,i,r,n,o,s){const a=this.length;return this.resize(a+1),this.emplace(a,e,t,i,r,n,o,s)}emplace(e,t,i,r,n,o,s,a){const l=6*e,c=12*e,h=3*e;return this.int16[l+0]=t,this.int16[l+1]=i,this.uint8[c+4]=r,this.uint8[c+5]=n,this.uint8[c+6]=o,this.uint8[c+7]=s,this.float32[h+2]=a,e}}Bl.prototype.bytesPerElement=12,wa(Bl,"StructArrayLayout2i4ub1f12");class Fl extends Pl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,i,r){const n=this.length;return this.resize(n+1),this.emplace(n,e,t,i,r)}emplace(e,t,i,r,n){const o=4*e;return this.float32[o+0]=t,this.float32[o+1]=i,this.float32[o+2]=r,this.float32[o+3]=n,e}}Fl.prototype.bytesPerElement=16,wa(Fl,"StructArrayLayout4f16");class Nl extends Pl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,i){const r=this.length;return this.resize(r+1),this.emplace(r,e,t,i)}emplace(e,t,i,r){const n=3*e;return this.float32[n+0]=t,this.float32[n+1]=i,this.float32[n+2]=r,e}}Nl.prototype.bytesPerElement=12,wa(Nl,"StructArrayLayout3f12");class Vl extends Pl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,i,r,n){const o=this.length;return this.resize(o+1),this.emplace(o,e,t,i,r,n)}emplace(e,t,i,r,n,o){const s=6*e,a=3*e;return this.uint16[s+0]=t,this.uint16[s+1]=i,this.uint16[s+2]=r,this.uint16[s+3]=n,this.float32[a+2]=o,e}}Vl.prototype.bytesPerElement=12,wa(Vl,"StructArrayLayout4ui1f12");class Ul extends Pl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,i,r){const n=this.length;return this.resize(n+1),this.emplace(n,e,t,i,r)}emplace(e,t,i,r,n){const o=4*e;return this.uint16[o+0]=t,this.uint16[o+1]=i,this.uint16[o+2]=r,this.uint16[o+3]=n,e}}Ul.prototype.bytesPerElement=8,wa(Ul,"StructArrayLayout4ui8");class jl extends Pl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,i,r,n,o){const s=this.length;return this.resize(s+1),this.emplace(s,e,t,i,r,n,o)}emplace(e,t,i,r,n,o,s){const a=6*e;return this.int16[a+0]=t,this.int16[a+1]=i,this.int16[a+2]=r,this.int16[a+3]=n,this.int16[a+4]=o,this.int16[a+5]=s,e}}jl.prototype.bytesPerElement=12,wa(jl,"StructArrayLayout6i12");class $l extends Pl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,i,r,n,o,s,a,l,c,h,u){const d=this.length;return this.resize(d+1),this.emplace(d,e,t,i,r,n,o,s,a,l,c,h,u)}emplace(e,t,i,r,n,o,s,a,l,c,h,u,d){const p=12*e;return this.int16[p+0]=t,this.int16[p+1]=i,this.int16[p+2]=r,this.int16[p+3]=n,this.uint16[p+4]=o,this.uint16[p+5]=s,this.uint16[p+6]=a,this.uint16[p+7]=l,this.int16[p+8]=c,this.int16[p+9]=h,this.int16[p+10]=u,this.int16[p+11]=d,e}}$l.prototype.bytesPerElement=24,wa($l,"StructArrayLayout4i4ui4i24");class Gl extends Pl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,i,r,n,o){const s=this.length;return this.resize(s+1),this.emplace(s,e,t,i,r,n,o)}emplace(e,t,i,r,n,o,s){const a=10*e,l=5*e;return this.int16[a+0]=t,this.int16[a+1]=i,this.int16[a+2]=r,this.float32[l+2]=n,this.float32[l+3]=o,this.float32[l+4]=s,e}}Gl.prototype.bytesPerElement=20,wa(Gl,"StructArrayLayout3i3f20");class ql extends Pl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(e){const t=this.length;return this.resize(t+1),this.emplace(t,e)}emplace(e,t){return this.uint32[1*e+0]=t,e}}ql.prototype.bytesPerElement=4,wa(ql,"StructArrayLayout1ul4");class Zl extends Pl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t){const i=this.length;return this.resize(i+1),this.emplace(i,e,t)}emplace(e,t,i){const r=2*e;return this.uint16[r+0]=t,this.uint16[r+1]=i,e}}Zl.prototype.bytesPerElement=4,wa(Zl,"StructArrayLayout2ui4");class Wl extends Pl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,i,r,n,o,s,a,l,c,h,u,d){const p=this.length;return this.resize(p+1),this.emplace(p,e,t,i,r,n,o,s,a,l,c,h,u,d)}emplace(e,t,i,r,n,o,s,a,l,c,h,u,d,p){const f=20*e,m=10*e;return this.int16[f+0]=t,this.int16[f+1]=i,this.int16[f+2]=r,this.int16[f+3]=n,this.int16[f+4]=o,this.float32[m+3]=s,this.float32[m+4]=a,this.float32[m+5]=l,this.float32[m+6]=c,this.int16[f+14]=h,this.uint32[m+8]=u,this.uint16[f+18]=d,this.uint16[f+19]=p,e}}Wl.prototype.bytesPerElement=40,wa(Wl,"StructArrayLayout5i4f1i1ul2ui40");class Hl extends Pl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,i,r,n,o,s){const a=this.length;return this.resize(a+1),this.emplace(a,e,t,i,r,n,o,s)}emplace(e,t,i,r,n,o,s,a){const l=8*e;return this.int16[l+0]=t,this.int16[l+1]=i,this.int16[l+2]=r,this.int16[l+4]=n,this.int16[l+5]=o,this.int16[l+6]=s,this.int16[l+7]=a,e}}Hl.prototype.bytesPerElement=16,wa(Hl,"StructArrayLayout3i2i2i16");class Xl extends Pl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,i,r,n){const o=this.length;return this.resize(o+1),this.emplace(o,e,t,i,r,n)}emplace(e,t,i,r,n,o){const s=4*e,a=8*e;return this.float32[s+0]=t,this.float32[s+1]=i,this.float32[s+2]=r,this.int16[a+6]=n,this.int16[a+7]=o,e}}Xl.prototype.bytesPerElement=16,wa(Xl,"StructArrayLayout2f1f2i16");class Yl extends Pl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,i,r){const n=this.length;return this.resize(n+1),this.emplace(n,e,t,i,r)}emplace(e,t,i,r,n){const o=12*e,s=3*e;return this.uint8[o+0]=t,this.uint8[o+1]=i,this.float32[s+1]=r,this.float32[s+2]=n,e}}Yl.prototype.bytesPerElement=12,wa(Yl,"StructArrayLayout2ub2f12");class Jl extends Pl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,i){const r=this.length;return this.resize(r+1),this.emplace(r,e,t,i)}emplace(e,t,i,r){const n=3*e;return this.uint16[n+0]=t,this.uint16[n+1]=i,this.uint16[n+2]=r,e}}Jl.prototype.bytesPerElement=6,wa(Jl,"StructArrayLayout3ui6");class Kl extends Pl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(e,t,i,r,n,o,s,a,l,c,h,u,d,p,f,m,_,g,y,x,v){const b=this.length;return this.resize(b+1),this.emplace(b,e,t,i,r,n,o,s,a,l,c,h,u,d,p,f,m,_,g,y,x,v)}emplace(e,t,i,r,n,o,s,a,l,c,h,u,d,p,f,m,_,g,y,x,v,b){const w=30*e,T=15*e,E=60*e;return this.int16[w+0]=t,this.int16[w+1]=i,this.int16[w+2]=r,this.float32[T+2]=n,this.float32[T+3]=o,this.uint16[w+8]=s,this.uint16[w+9]=a,this.uint32[T+5]=l,this.uint32[T+6]=c,this.uint32[T+7]=h,this.uint16[w+16]=u,this.uint16[w+17]=d,this.uint16[w+18]=p,this.float32[T+10]=f,this.float32[T+11]=m,this.uint8[E+48]=_,this.uint8[E+49]=g,this.uint8[E+50]=y,this.uint32[T+13]=x,this.int16[w+28]=v,this.uint8[E+58]=b,e}}Kl.prototype.bytesPerElement=60,wa(Kl,"StructArrayLayout3i2f2ui3ul3ui2f3ub1ul1i1ub60");class Ql extends Pl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(e,t,i,r,n,o,s,a,l,c,h,u,d,p,f,m,_,g,y,x,v,b,w,T,E,S,M,A,I,C,P,z){const D=this.length;return this.resize(D+1),this.emplace(D,e,t,i,r,n,o,s,a,l,c,h,u,d,p,f,m,_,g,y,x,v,b,w,T,E,S,M,A,I,C,P,z)}emplace(e,t,i,r,n,o,s,a,l,c,h,u,d,p,f,m,_,g,y,x,v,b,w,T,E,S,M,A,I,C,P,z,D){const R=20*e,L=40*e,k=80*e;return this.float32[R+0]=t,this.float32[R+1]=i,this.int16[L+4]=r,this.int16[L+5]=n,this.int16[L+6]=o,this.int16[L+7]=s,this.int16[L+8]=a,this.int16[L+9]=l,this.int16[L+10]=c,this.int16[L+11]=h,this.int16[L+12]=u,this.uint16[L+13]=d,this.uint16[L+14]=p,this.uint16[L+15]=f,this.uint16[L+16]=m,this.uint16[L+17]=_,this.uint16[L+18]=g,this.uint16[L+19]=y,this.uint16[L+20]=x,this.uint16[L+21]=v,this.uint16[L+22]=b,this.uint16[L+23]=w,this.uint16[L+24]=T,this.uint16[L+25]=E,this.uint16[L+26]=S,this.uint16[L+27]=M,this.uint32[R+14]=A,this.float32[R+15]=I,this.float32[R+16]=C,this.float32[R+17]=P,this.float32[R+18]=z,this.uint8[k+76]=D,e}}Ql.prototype.bytesPerElement=80,wa(Ql,"StructArrayLayout2f9i15ui1ul4f1ub80");class ec extends Pl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e){const t=this.length;return this.resize(t+1),this.emplace(t,e)}emplace(e,t){return this.float32[1*e+0]=t,e}}ec.prototype.bytesPerElement=4,wa(ec,"StructArrayLayout1f4");class tc extends Pl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,i,r,n){const o=this.length;return this.resize(o+1),this.emplace(o,e,t,i,r,n)}emplace(e,t,i,r,n,o){const s=5*e;return this.float32[s+0]=t,this.float32[s+1]=i,this.float32[s+2]=r,this.float32[s+3]=n,this.float32[s+4]=o,e}}tc.prototype.bytesPerElement=20,wa(tc,"StructArrayLayout5f20");class ic extends Pl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,i,r,n,o,s){const a=this.length;return this.resize(a+1),this.emplace(a,e,t,i,r,n,o,s)}emplace(e,t,i,r,n,o,s,a){const l=7*e;return this.float32[l+0]=t,this.float32[l+1]=i,this.float32[l+2]=r,this.float32[l+3]=n,this.float32[l+4]=o,this.float32[l+5]=s,this.float32[l+6]=a,e}}ic.prototype.bytesPerElement=28,wa(ic,"StructArrayLayout7f28");class rc extends Pl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,i,r){const n=this.length;return this.resize(n+1),this.emplace(n,e,t,i,r)}emplace(e,t,i,r,n){const o=6*e;return this.uint32[3*e+0]=t,this.uint16[o+2]=i,this.uint16[o+3]=r,this.uint16[o+4]=n,e}}rc.prototype.bytesPerElement=12,wa(rc,"StructArrayLayout1ul3ui12");class nc extends Pl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e){const t=this.length;return this.resize(t+1),this.emplace(t,e)}emplace(e,t){return this.uint16[1*e+0]=t,e}}nc.prototype.bytesPerElement=2,wa(nc,"StructArrayLayout1ui2");class oc extends Pl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t){const i=this.length;return this.resize(i+1),this.emplace(i,e,t)}emplace(e,t,i){const r=2*e;return this.float32[r+0]=t,this.float32[r+1]=i,e}}oc.prototype.bytesPerElement=8,wa(oc,"StructArrayLayout2f8");class sc extends Pl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,i,r,n,o,s,a,l,c,h,u,d,p,f,m){const _=this.length;return this.resize(_+1),this.emplace(_,e,t,i,r,n,o,s,a,l,c,h,u,d,p,f,m)}emplace(e,t,i,r,n,o,s,a,l,c,h,u,d,p,f,m,_){const g=16*e;return this.float32[g+0]=t,this.float32[g+1]=i,this.float32[g+2]=r,this.float32[g+3]=n,this.float32[g+4]=o,this.float32[g+5]=s,this.float32[g+6]=a,this.float32[g+7]=l,this.float32[g+8]=c,this.float32[g+9]=h,this.float32[g+10]=u,this.float32[g+11]=d,this.float32[g+12]=p,this.float32[g+13]=f,this.float32[g+14]=m,this.float32[g+15]=_,e}}sc.prototype.bytesPerElement=64,wa(sc,"StructArrayLayout16f64");class ac extends Pl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,i,r,n,o,s){const a=this.length;return this.resize(a+1),this.emplace(a,e,t,i,r,n,o,s)}emplace(e,t,i,r,n,o,s,a){const l=10*e,c=5*e;return this.uint16[l+0]=t,this.uint16[l+1]=i,this.uint16[l+2]=r,this.uint16[l+3]=n,this.float32[c+2]=o,this.float32[c+3]=s,this.float32[c+4]=a,e}}ac.prototype.bytesPerElement=20,wa(ac,"StructArrayLayout4ui3f20");class lc extends Pl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e){const t=this.length;return this.resize(t+1),this.emplace(t,e)}emplace(e,t){return this.int16[1*e+0]=t,e}}lc.prototype.bytesPerElement=2,wa(lc,"StructArrayLayout1i2");class cc extends Pl{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer)}emplaceBack(e){const t=this.length;return this.resize(t+1),this.emplace(t,e)}emplace(e,t){return this.uint8[1*e+0]=t,e}}cc.prototype.bytesPerElement=1,wa(cc,"StructArrayLayout1ub1");class hc extends Cl{get projectedAnchorX(){return this._structArray.int16[this._pos2+0]}get projectedAnchorY(){return this._structArray.int16[this._pos2+1]}get projectedAnchorZ(){return this._structArray.int16[this._pos2+2]}get tileAnchorX(){return this._structArray.int16[this._pos2+3]}get tileAnchorY(){return this._structArray.int16[this._pos2+4]}get x1(){return this._structArray.float32[this._pos4+3]}get y1(){return this._structArray.float32[this._pos4+4]}get x2(){return this._structArray.float32[this._pos4+5]}get y2(){return this._structArray.float32[this._pos4+6]}get padding(){return this._structArray.int16[this._pos2+14]}get featureIndex(){return this._structArray.uint32[this._pos4+8]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+18]}get bucketIndex(){return this._structArray.uint16[this._pos2+19]}}hc.prototype.size=40;class uc extends Wl{get(e){return new hc(this,e)}}wa(uc,"CollisionBoxArray");class dc extends Cl{get projectedAnchorX(){return this._structArray.int16[this._pos2+0]}get projectedAnchorY(){return this._structArray.int16[this._pos2+1]}get projectedAnchorZ(){return this._structArray.int16[this._pos2+2]}get tileAnchorX(){return this._structArray.float32[this._pos4+2]}get tileAnchorY(){return this._structArray.float32[this._pos4+3]}get glyphStartIndex(){return this._structArray.uint16[this._pos2+8]}get numGlyphs(){return this._structArray.uint16[this._pos2+9]}get vertexStartIndex(){return this._structArray.uint32[this._pos4+5]}get lineStartIndex(){return this._structArray.uint32[this._pos4+6]}get lineLength(){return this._structArray.uint32[this._pos4+7]}get segment(){return this._structArray.uint16[this._pos2+16]}get lowerSize(){return this._structArray.uint16[this._pos2+17]}get upperSize(){return this._structArray.uint16[this._pos2+18]}get lineOffsetX(){return this._structArray.float32[this._pos4+10]}get lineOffsetY(){return this._structArray.float32[this._pos4+11]}get writingMode(){return this._structArray.uint8[this._pos1+48]}get placedOrientation(){return this._structArray.uint8[this._pos1+49]}set placedOrientation(e){this._structArray.uint8[this._pos1+49]=e}get hidden(){return this._structArray.uint8[this._pos1+50]}set hidden(e){this._structArray.uint8[this._pos1+50]=e}get crossTileID(){return this._structArray.uint32[this._pos4+13]}set crossTileID(e){this._structArray.uint32[this._pos4+13]=e}get associatedIconIndex(){return this._structArray.int16[this._pos2+28]}get flipState(){return this._structArray.uint8[this._pos1+58]}set flipState(e){this._structArray.uint8[this._pos1+58]=e}}dc.prototype.size=60;class pc extends Kl{get(e){return new dc(this,e)}}wa(pc,"PlacedSymbolArray");class fc extends Cl{get tileAnchorX(){return this._structArray.float32[this._pos4+0]}get tileAnchorY(){return this._structArray.float32[this._pos4+1]}get projectedAnchorX(){return this._structArray.int16[this._pos2+4]}get projectedAnchorY(){return this._structArray.int16[this._pos2+5]}get projectedAnchorZ(){return this._structArray.int16[this._pos2+6]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+7]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+8]}get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+9]}get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+10]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+11]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+12]}get key(){return this._structArray.uint16[this._pos2+13]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+14]}get textBoxEndIndex(){return this._structArray.uint16[this._pos2+15]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+16]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+17]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+18]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+19]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+20]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+21]}get featureIndex(){return this._structArray.uint16[this._pos2+22]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+23]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+24]}get numIconVertices(){return this._structArray.uint16[this._pos2+25]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+26]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+27]}get crossTileID(){return this._structArray.uint32[this._pos4+14]}set crossTileID(e){this._structArray.uint32[this._pos4+14]=e}get textOffset0(){return this._structArray.float32[this._pos4+15]}get textOffset1(){return this._structArray.float32[this._pos4+16]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+17]}get zOffset(){return this._structArray.float32[this._pos4+18]}set zOffset(e){this._structArray.float32[this._pos4+18]=e}get hasIconTextFit(){return this._structArray.uint8[this._pos1+76]}}fc.prototype.size=80;class mc extends Ql{get(e){return new fc(this,e)}}wa(mc,"SymbolInstanceArray");class _c extends ec{getoffsetX(e){return this.float32[1*e+0]}}wa(_c,"GlyphOffsetArray");class gc extends Rl{getx(e){return this.int16[2*e+0]}gety(e){return this.int16[2*e+1]}}wa(gc,"SymbolLineVertexArray");class yc extends Cl{get featureIndex(){return this._structArray.uint32[this._pos4+0]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+2]}get bucketIndex(){return this._structArray.uint16[this._pos2+3]}get layoutVertexArrayOffset(){return this._structArray.uint16[this._pos2+4]}}yc.prototype.size=12;class xc extends rc{get(e){return new yc(this,e)}}wa(xc,"FeatureIndexArray");class vc extends Zl{geta_centroid_pos0(e){return this.uint16[2*e+0]}geta_centroid_pos1(e){return this.uint16[2*e+1]}}wa(vc,"FillExtrusionCentroidArray");class bc extends Cl{get a_join_normal_inside_polygon0(){return this._structArray.int16[this._pos2+0]}get a_join_normal_inside_polygon1(){return this._structArray.int16[this._pos2+1]}get a_join_normal_inside_polygon2(){return this._structArray.int16[this._pos2+2]}get a_join_normal_inside_polygon3(){return this._structArray.int16[this._pos2+3]}}bc.prototype.size=8;class wc extends kl{get(e){return new bc(this,e)}}wa(wc,"FillExtrusionWallArray");const Tc=zl([{name:"a_pos",components:2,type:"Int16"}],4),Ec=zl([{name:"a_pos_3",components:3,type:"Int16"},{name:"a_pos_normal_3",components:3,type:"Int16"}]);class Sc{constructor(e=[]){this.segments=e}_prepareSegment(e,t,i,r){let n=this.segments[this.segments.length-1];return e>Sc.MAX_VERTEX_ARRAY_LENGTH&&fi(`Max vertices per segment is ${Sc.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${e}`),(!n||n.vertexLength+e>Sc.MAX_VERTEX_ARRAY_LENGTH||n.sortKey!==r)&&(n={vertexOffset:t,primitiveOffset:i,vertexLength:0,primitiveLength:0},void 0!==r&&(n.sortKey=r),this.segments.push(n)),n}prepareSegment(e,t,i,r){return this._prepareSegment(e,t.length,i.length,r)}get(){return this.segments}destroy(){for(const e of this.segments)for(const t in e.vaos)e.vaos[t].destroy()}static simpleSegment(e,t,i,r){return new Sc([{vertexOffset:e,primitiveOffset:t,vertexLength:i,primitiveLength:r,vaos:{},sortKey:0}])}}function Mc(e,t){return 256*(e=Jt(Math.floor(e),0,255))+Jt(Math.floor(t),0,255)}Sc.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,wa(Sc,"SegmentVector");const Ac=zl([{name:"a_pattern",components:4,type:"Uint16"},{name:"a_pixel_ratio",components:1,type:"Float32"}]),Ic=zl([{name:"a_dash",components:4,type:"Uint16"}]);class Cc{constructor(){this.ids=[],this.uniqueIds=[],this.positions=[],this.indexed=!1}add(e,t,i,r){this.ids.push(Pc(e)),this.positions.push(t,i,r)}eachPosition(e,t){const i=Pc(e);let r=0,n=this.ids.length-1;for(;r>1;this.ids[e]>=i?n=e:r=e+1}for(;this.ids[r]===i;)t(this.positions[3*r],this.positions[3*r+1],this.positions[3*r+2]),r++}static serialize(e,t){const i=new Float64Array(e.ids),r=new Uint32Array(e.positions);return zc(i,r,0,i.length-1),t&&(t.add(i.buffer),t.add(r.buffer)),{ids:i,positions:r}}static deserialize(e){const t=new Cc;let i;t.ids=e.ids,t.positions=e.positions;for(const e of t.ids)e!==i&&t.uniqueIds.push(e),i=e;return t.indexed=!0,t}}function Pc(e){const t=+e;return!isNaN(t)&&Number.MIN_SAFE_INTEGER<=t&&t<=Number.MAX_SAFE_INTEGER?t:Dr(String(e))}function zc(e,t,i,r){for(;i>1];let o=i-1,s=r+1;for(;;){do{o++}while(e[o]n);if(o>=s)break;Dc(e,o,s),Dc(t,3*o,3*s),Dc(t,3*o+1,3*s+1),Dc(t,3*o+2,3*s+2)}s-i`u_${e}`)),this.type=i,this.context=r}setUniform(e,t,i,r,n){const o=r.constantOr(this.value);t.set(e,n,o instanceof $r?o.toRenderColor(this.context.lut):o)}getBinding(e,t){return"color"===this.type?new Nc(e):new kc(e)}}class Wc{constructor(e,t){this.uniformNames=t.map((e=>`u_${e}`)),this.pattern=null,this.pixelRatio=1}setConstantPatternPositions(e){this.pixelRatio=e.pixelRatio||1,this.pattern=e.tl.concat(e.br)}setUniform(e,t,i,r,n){const o="u_pattern"===n||"u_dash"===n?this.pattern:"u_pixel_ratio"===n?this.pixelRatio:null;o&&t.set(e,n,o)}getBinding(e,t){return"u_pattern"===t||"u_dash"===t?new Fc(e):new kc(e)}}class Hc{constructor(e,t,i,r){this.expression=e,this.type=i,this.maxValue=0,this.paintVertexAttributes=t.map((e=>({name:`a_${e}`,type:"Float32",components:"color"===i?2:1,offset:0}))),this.paintVertexArray=new r}populatePaintArray(e,t,i,r,n,o,s){const a=this.paintVertexArray.length,l=this.expression.evaluate(new Ha(0,{brightness:o}),t,{},n,r,s);this.paintVertexArray.resize(e),this._setPaintValue(a,e,l,this.context)}updatePaintArray(e,t,i,r,n,o,s){const a=this.expression.evaluate({zoom:0,brightness:s},i,r,void 0,n);this._setPaintValue(e,t,a,this.context)}_setPaintValue(e,t,i,r){if("color"===this.type){const n=qc(i.toRenderColor(r.lut));for(let i=e;i`u_${e}_t`)),this.type=i,this.useIntegerZoom=r,this.context=n,this.maxValue=0,this.paintVertexAttributes=t.map((e=>({name:`a_${e}`,type:"Float32",components:"color"===i?4:2,offset:0}))),this.paintVertexArray=new o}populatePaintArray(e,t,i,r,n,o,s){const a=this.expression.evaluate(new Ha(this.context.zoom,{brightness:o}),t,{},n,r,s),l=this.expression.evaluate(new Ha(this.context.zoom+1,{brightness:o}),t,{},n,r,s),c=this.paintVertexArray.length;this.paintVertexArray.resize(e),this._setPaintValue(c,e,a,l,this.context)}updatePaintArray(e,t,i,r,n,o,s){const a=this.expression.evaluate({zoom:this.context.zoom,brightness:s},i,r,void 0,n),l=this.expression.evaluate({zoom:this.context.zoom+1,brightness:s},i,r,void 0,n);this._setPaintValue(e,t,a,l,this.context)}_setPaintValue(e,t,i,r,n){if("color"===this.type){const r=qc(i.toRenderColor(n.lut)),o=qc(i.toRenderColor(n.lut));for(let i=e;i!0){this.binders={},this._buffers=[],this.context=t;const r=[];for(const n in e.paint._values){const o=e.paint.get(n);if(!i(n))continue;if(!(o instanceof tl&&Js(o.property.specification)))continue;const s=eh(n,e.type),a=o.value,l=o.property.specification.type,c=!!o.property.useIntegerZoom,h="line-dasharray"===n||n.endsWith("pattern"),u="line-dasharray"===n&&"constant"!==e.layout.get("line-cap").value.kind;if("constant"!==a.kind||u)if("source"===a.kind||u||h){const t=rh(n,l,"source");this.binders[n]=h?new Yc(a,s,l,t,e.id):new Hc(a,s,l,t),r.push(`/a_${n}`)}else{const e=rh(n,l,"composite");this.binders[n]=new Xc(a,s,l,c,t,e),r.push(`/z_${n}`)}else this.binders[n]=h?new Wc(a.value,s):new Zc(a.value,s,l,t),r.push(`/u_${n}`)}this.cacheKey=r.sort().join("")}getMaxValue(e){const t=this.binders[e];return t instanceof Hc||t instanceof Xc?t.maxValue:0}populatePaintArrays(e,t,i,r,n,o,s){for(const a in this.binders){const l=this.binders[a];l.context=this.context,(l instanceof Hc||l instanceof Xc||l instanceof Yc)&&l.populatePaintArray(e,t,i,r,n,o,s)}}setConstantPatternPositions(e){for(const t in this.binders){const i=this.binders[t];i instanceof Wc&&i.setConstantPatternPositions(e)}}updatePaintArrays(e,t,i,r,n,o,s,a){let l=!1;const c=Object.keys(e),h=0!==c.length,u=h?c:t.uniqueIds;this.context.lut=n.lut;for(const c in this.binders){const d=this.binders[c];if(d.context=this.context,(d instanceof Hc||d instanceof Xc||d instanceof Yc)&&(!0===d.expression.isStateDependent||!1===d.expression.isLightConstant)){const p=n.paint.get(c);d.expression=p.value;for(const i of u){const n=e[i.toString()];t.eachPosition(i,((e,t,i)=>{const l=r.feature(e);d.updatePaintArray(t,i,l,n,o,s,a)}))}if(!h)for(const t of i.uniqueIds){const n=e[t.toString()];i.eachPosition(t,((e,t,i)=>{const l=r.feature(e);d.updatePaintArray(t,i,l,n,o,s,a)}))}l=!0}}return l}defines(){const e=[];for(const t in this.binders){const i=this.binders[t];(i instanceof Zc||i instanceof Wc)&&e.push(...i.uniformNames.map((e=>`#define HAS_UNIFORM_${e}`)))}return e}getBinderAttributes(){const e=[];for(const t in this.binders){const i=this.binders[t];if(i instanceof Hc||i instanceof Xc||i instanceof Yc)for(let t=0;t!0){this.programConfigurations={};for(const r of e)this.programConfigurations[r.id]=new Jc(r,t,i);this.needsUpload=!1,this._featureMap=new Cc,this._featureMapWithoutIds=new Cc,this._bufferOffset=0,this._idlessCounter=0}populatePaintArrays(e,t,i,r,n,o,s,a){for(const i in this.programConfigurations)this.programConfigurations[i].populatePaintArrays(e,t,r,n,o,s,a);void 0!==t.id?this._featureMap.add(t.id,i,this._bufferOffset,e):(this._featureMapWithoutIds.add(this._idlessCounter,i,this._bufferOffset,e),this._idlessCounter+=1),this._bufferOffset=e,this.needsUpload=!0}updatePaintArrays(e,t,i,r,n,o){for(const s of i)this.needsUpload=this.programConfigurations[s.id].updatePaintArrays(e,this._featureMap,this._featureMapWithoutIds,t,s,r,n,o||0)||this.needsUpload}get(e){return this.programConfigurations[e]}upload(e){if(this.needsUpload){for(const t in this.programConfigurations)this.programConfigurations[t].upload(e);this.needsUpload=!1}}destroy(){for(const e in this.programConfigurations)this.programConfigurations[e].destroy()}}const Qc={"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-occlusion-opacity":["occlusion_opacity"],"icon-occlusion-opacity":["occlusion_opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-emissive-strength":["emissive_strength"],"icon-emissive-strength":["emissive_strength"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"line-gap-width":["gapwidth"],"line-pattern":["pattern","pixel_ratio"],"fill-pattern":["pattern","pixel_ratio"],"fill-extrusion-pattern":["pattern","pixel_ratio"],"line-dasharray":["dash"]};function eh(e,t){return Qc[e]||[e.replace(`${t}-`,"").replace(/-/g,"_")]}const th={"line-pattern":{source:Vl,composite:Vl},"fill-pattern":{source:Vl,composite:Vl},"fill-extrusion-pattern":{source:Vl,composite:Vl},"line-dasharray":{source:Ul,composite:Ul}},ih={color:{source:oc,composite:Fl},number:{source:ec,composite:oc}};function rh(e,t,i){const r=th[e];return r&&r[i]||ih[t][i]}wa(Zc,"ConstantBinder"),wa(Wc,"PatternConstantBinder"),wa(Hc,"SourceExpressionBinder"),wa(Yc,"PatternCompositeBinder"),wa(Xc,"CompositeExpressionBinder"),wa(Jc,"ProgramConfiguration",{omit:["_buffers"]}),wa(Kc,"ProgramConfigurationSet");const nh=uo/Math.PI/2,oh=5,sh=6,ah=16383,lh=64,ch=[lh,32,16],hh=-nh,uh=nh;function dh(e,t,i,r=nh){return i=qt(i),[e*Math.sin(i)*r,-t*r,e*Math.cos(i)*r]}function ph(e,t,i){return dh(Math.cos(qt(e)),Math.sin(qt(e)),t,i)}const fh=6371008.8,mh=2*Math.PI*fh;class _h{constructor(e,t){if(isNaN(e)||isNaN(t))throw new Error(`Invalid LngLat object: (${e}, ${t})`);if(this.lng=+e,this.lat=+t,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new _h(Qt(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(e){const t=Math.PI/180,i=this.lat*t,r=e.lat*t,n=Math.sin(i)*Math.sin(r)+Math.cos(i)*Math.cos(r)*Math.cos((e.lng-this.lng)*t);return fh*Math.acos(Math.min(n,1))}toBounds(e=0){const t=360*e/40075017,i=t/Math.cos(Math.PI/180*this.lat);return new gh({lng:this.lng-i,lat:this.lat-t},{lng:this.lng+i,lat:this.lat+t})}toEcef(e){return ph(this.lat,this.lng,nh+e*nh/fh)}static convert(e){if(e instanceof _h)return e;if(Array.isArray(e)&&(2===e.length||3===e.length))return new _h(Number(e[0]),Number(e[1]));if(!Array.isArray(e)&&"object"==typeof e&&null!==e)return new _h(Number("lng"in e?e.lng:e.lon),Number(e.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: , lat: }, an object {lon: , lat: }, or an array of [, ]")}}class gh{constructor(e,t){if(e)if(t)this.setSouthWest(e).setNorthEast(t);else if(4===e.length){const t=e;this.setSouthWest([t[0],t[1]]).setNorthEast([t[2],t[3]])}else{const t=e;this.setSouthWest(t[0]).setNorthEast(t[1])}}setNorthEast(e){return this._ne=e instanceof _h?new _h(e.lng,e.lat):_h.convert(e),this}setSouthWest(e){return this._sw=e instanceof _h?new _h(e.lng,e.lat):_h.convert(e),this}extend(e){const t=this._sw,i=this._ne;let r,n;if(e instanceof _h)r=e,n=e;else{if(!(e instanceof gh))return Array.isArray(e)?4===e.length||e.every(Array.isArray)?this.extend(gh.convert(e)):this.extend(_h.convert(e)):"object"==typeof e&&null!==e&&e.hasOwnProperty("lat")&&(e.hasOwnProperty("lon")||e.hasOwnProperty("lng"))?this.extend(_h.convert(e)):this;if(r=e._sw,n=e._ne,!r||!n)return this}return t||i?(t.lng=Math.min(r.lng,t.lng),t.lat=Math.min(r.lat,t.lat),i.lng=Math.max(n.lng,i.lng),i.lat=Math.max(n.lat,i.lat)):(this._sw=new _h(r.lng,r.lat),this._ne=new _h(n.lng,n.lat)),this}getCenter(){return new _h((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 _h(this.getWest(),this.getNorth())}getSouthEast(){return new _h(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:t,lat:i}=_h.convert(e);let r=this._sw.lng<=t&&t<=this._ne.lng;return this._sw.lng>this._ne.lng&&(r=this._sw.lng>=t&&t>=this._ne.lng),this._sw.lat<=i&&i<=this._ne.lat&&r}static convert(e){return!e||e instanceof gh?e:new gh(e)}}var yh={};!(function(e,t){!(function(e){function t(e,t,r){var n=i(256*e,256*(t=Math.pow(2,r)-t-1),r),o=i(256*(e+1),256*(t+1),r);return n[0]+","+n[1]+","+o[0]+","+o[1]}function i(e,t,i){var r=2*Math.PI*6378137/256/Math.pow(2,i);return[e*r-2*Math.PI*6378137/2,t*r-2*Math.PI*6378137/2]}e.getURL=function(e,i,r,n,o,s){return s=s||{},e+"?"+["bbox="+t(r,n,o),"format="+(s.format||"image/png"),"service="+(s.service||"WMS"),"version="+(s.version||"1.1.1"),"request="+(s.request||"GetMap"),"srs="+(s.srs||"EPSG:3857"),"width="+(s.width||256),"height="+(s.height||256),"layers="+i].join("&")},e.getTileBBox=t,e.getMercCoords=i,Object.defineProperty(e,"__esModule",{value:!0})})(t)})(0,yh);var xh=yh;class vh{constructor(e,t,i){this.z=e,this.x=t,this.y=i,this.key=Th(0,e,e,t,i)}equals(e){return this.z===e.z&&this.x===e.x&&this.y===e.y}url(e,t){const i=xh.getTileBBox(this.x,this.y,this.z),r=(function(e,t,i){let r,n="";for(let o=e;o>0;o--)r=1<this.canonical.z?new wh(e,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new wh(e,this.wrap,e,this.canonical.x>>t,this.canonical.y>>t)}calculateScaledKey(e,t=!0){if(this.overscaledZ===e&&t)return this.key;if(e>this.canonical.z)return Th(this.wrap*+t,e,this.canonical.z,this.canonical.x,this.canonical.y);{const i=this.canonical.z-e;return Th(this.wrap*+t,e,e,this.canonical.x>>i,this.canonical.y>>i)}}isChildOf(e){if(e.wrap!==this.wrap)return!1;const t=this.canonical.z-e.canonical.z;return 0===e.overscaledZ||e.overscaledZ>t&&e.canonical.y===this.canonical.y>>t}children(e){if(this.overscaledZ>=e)return[new wh(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];const t=this.canonical.z+1,i=2*this.canonical.x,r=2*this.canonical.y;return[new wh(t,this.wrap,t,i,r),new wh(t,this.wrap,t,i+1,r),new wh(t,this.wrap,t,i,r+1),new wh(t,this.wrap,t,i+1,r+1)]}isLessThan(e){return this.wrape.wrap)&&(this.overscaledZe.overscaledZ)&&(this.canonical.xe.canonical.x)&&this.canonical.y{let t=e.canonical.x-1,i=e.wrap;return t<0&&(t=(1<{let t=e.canonical.x+1,i=e.wrap;return t===1<new wh(e.overscaledZ,e.wrap,e.canonical.z,e.canonical.x,(0===e.canonical.y?1<new wh(e.overscaledZ,e.wrap,e.canonical.z,e.canonical.x,e.canonical.y===(1<=l?(Vh(e,t,i,c,h,o,u,a,l),Vh(e,c,h,r,n,u,s,a,l)):e.push(s)}function Uh(e,t,i){let r=e[0],n=r.x,o=r.y;t(r);const s=[r];for(let a=1;ae.x+1||re.y+1)&&fi("Geometry exceeds allowed extent, reduce your vector tile buffer size"),e}function Wh(e,t,i){const r=e.loadGeometry(),n=e.extent,o=uo/n;if(t&&i&&i.projection.isReprojectedInTileSpace){const o=1<{const i=zh((t.x+e.x/n)/o),r=Dh((t.y+e.y/n)/o),h=c.project(i,r);e.x=(h.x*s-a)*n,e.y=(h.y*s-l)*n};for(let t=0;t=n||i.y<0||i.y>=n||(h(i),e.push(i));r[t]=e}}for(const e of r)for(const t of e)Zh(t,o);return r}function Hh(e,t){return{type:e.type,id:e.id,properties:e.properties,geometry:t?Wh(e):[]}}function Xh(e,t,i,r,n){e.emplaceBack(2*t+(r+1)/2,2*i+(n+1)/2)}function Yh(e,t,i){const r=16384;e.emplaceBack(t.x,t.y,t.z,i[0]*r,i[1]*r,i[2]*r)}class Jh{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((e=>e.fqid)),this.index=e.index,this.hasPattern=!1,this.projection=e.projection,this.layoutVertexArray=new Rl,this.indexArray=new Jl,this.segments=new Sc,this.programConfigurations=new Kc(e.layers,{zoom:e.zoom,lut:e.lut}),this.stateDependentLayerIds=this.layers.filter((e=>e.isStateDependent())).map((e=>e.id))}updateFootprints(e,t){}populate(e,t,i,r){const n=this.layers[0],o=[];let s=null;"circle"===n.type&&(s=n.layout.get("circle-sort-key"));for(const{feature:t,id:n,index:a,sourceLayerIndex:l}of e){const e=this.layers[0]._featureFilter.needGeometry,c=Hh(t,e);if(!this.layers[0]._featureFilter.filter(new Ha(this.zoom),c,i))continue;const h=s?s.evaluate(c,{},i):void 0,u={id:n,properties:t.properties,type:t.type,sourceLayerIndex:l,index:a,geometry:e?c.geometry:Wh(t,i,r),patterns:{},sortKey:h};o.push(u)}s&&o.sort(((e,t)=>e.sortKey-t.sortKey));let a=null;"globe"===r.projection.name&&(this.globeExtVertexArray=new jl,a=r.projection);for(const r of o){const{geometry:n,index:o,sourceLayerIndex:s}=r,l=e[o].feature;this.addFeature(r,n,o,t.availableImages,i,a,t.brightness),t.featureIndex.insert(l,n,o,s,this.index)}}update(e,t,i,r,n){const o=0!==Object.keys(e).length;o&&!this.stateDependentLayers.length||this.programConfigurations.updatePaintArrays(e,t,o?this.stateDependentLayers:this.layers,i,r,n)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Tc.members),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.globeExtVertexArray&&(this.globeExtVertexBuffer=e.createVertexBuffer(this.globeExtVertexArray,Ec.members))),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.globeExtVertexBuffer&&this.globeExtVertexBuffer.destroy())}addFeature(e,t,i,r,n,o,s){for(const i of t)for(const t of i){const i=t.x,r=t.y;if(i<0||i>=uo||r<0||r>=uo)continue;if(o){const e=o.projectTilePoint(i,r,n),t=o.upVector(n,i,r),s=this.globeExtVertexArray;Yh(s,e,t),Yh(s,e,t),Yh(s,e,t),Yh(s,e,t)}const s=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,e.sortKey),a=s.vertexLength;Xh(this.layoutVertexArray,i,r,-1,-1),Xh(this.layoutVertexArray,i,r,1,-1),Xh(this.layoutVertexArray,i,r,1,1),Xh(this.layoutVertexArray,i,r,-1,1),this.indexArray.emplaceBack(a,a+1,a+2),this.indexArray.emplaceBack(a,a+2,a+3),s.vertexLength+=4,s.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,i,{},r,n,s)}}function Kh(e,t){for(let i=0;i1){if(iu(e,t))return!0;for(let r=0;r1?i:i.sub(t)._mult(n)._add(t))}function su(e,t){let i,r,n,o=!1;for(let s=0;st.y!=n.y>t.y&&t.x<(n.x-r.x)*(t.y-r.y)/(n.y-r.y)+r.x&&(o=!o)}return o}function au(e,t){let i=!1;for(let r=0,n=e.length-1;rt.y!=s.y>t.y&&t.x<(s.x-o.x)*(t.y-o.y)/(s.y-o.y)+o.x&&(i=!i)}return i}function lu(e,t,i,r,n){for(const o of e)if(t<=o.x&&i<=o.y&&r>=o.x&&n>=o.y)return!0;const o=[new Ut(t,i),new Ut(t,n),new Ut(r,n),new Ut(r,i)];if(e.length>2)for(const t of o)if(au(e,t))return!0;for(let t=0;tn.x&&t.x>n.x||e.yn.y&&t.y>n.y)return!1;const o=mi(e,t,i[0]);return o!==mi(e,t,i[1])||o!==mi(e,t,i[2])||o!==mi(e,t,i[3])}function hu(e,t,i,r,n,o){let s=t.y-e.y,a=e.x-t.x;if(o=o||0){const e=s*s+a*a;if(0===e)return!0;const t=Math.sqrt(e);s/=t,a/=t}return!((i.x-e.x)*s+(i.y-e.y)*a-o<0||(r.x-e.x)*s+(r.y-e.y)*a-o<0||(n.x-e.x)*s+(n.y-e.y)*a-o<0)}function uu(e,t,i,r,n,o,s){return!(hu(e,t,r,n,o,s)||hu(t,i,r,n,o,s)||hu(i,e,r,n,o,s)||hu(r,n,e,t,i,s)||hu(n,o,e,t,i,s)||hu(o,r,e,t,i,s))}function du(e,t,i){const r=t.paint.get(e).value;return"constant"===r.kind?r.value:i.programConfigurations.get(t.id).getMaxValue(e)}function pu(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])}function fu(e,t,i,r,n){if(!t[0]&&!t[1])return e;const o=Ut.convert(t)._mult(n);"viewport"===i&&o._rotate(-r);const s=[];for(let t=0;t=0;if(0===s)return 0;s!==i.length&&(r=!1)}return r?2:1}function wu(e,t){for(const i of e.projections){const r=vu(t,e.points[0],i.axis);if(i.projection[1]r[1])return 0}return 1}function Tu(t,i){let r=0;const n=[0,0,0,0];for(let o=0;o=0&&r++;return r}class Eu{constructor(t,i){this.points=t||new Array(8).fill([0,0,0]),this.planes=i||new Array(6).fill([0,0,0,0]),this.bounds=Su.fromPoints(this.points),this.projections=[],this.frustumEdges=[e.$.sub([],this.points[2],this.points[3]),e.$.sub([],this.points[0],this.points[3]),e.$.sub([],this.points[4],this.points[0]),e.$.sub([],this.points[5],this.points[1]),e.$.sub([],this.points[6],this.points[2]),e.$.sub([],this.points[7],this.points[3])];for(const e of this.frustumEdges){const t=[0,-e[2],e[1]],i=[e[2],0,-e[0]];this.projections.push({axis:t,projection:vu(this.points,this.points[0],t)}),this.projections.push({axis:i,projection:vu(this.points,this.points[0],i)})}}static fromInvProjectionMatrix(t,i,r,n){const o=Math.pow(2,r),s=[[-1,1,-1,1],[1,1,-1,1],[1,-1,-1,1],[-1,-1,-1,1],[-1,1,1,1],[1,1,1,1],[1,-1,1,1],[-1,-1,1,1]].map((r=>{const s=e.aB.transformMat4([],r,t),a=1/s[3]/i*o;return e.aB.mul(s,s,[a,a,n?1/s[3]:a,a])})),a=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map((t=>{const i=e.$.sub([],s[t[0]],s[t[1]]),r=e.$.sub([],s[t[2]],s[t[1]]),n=e.$.normalize([],e.$.cross([],i,r)),o=-e.$.dot(n,s[t[1]]);return n.concat(o)})),l=[];for(let e=0;ea[1]||a[0]>s[1])return 0}return 1}containsPoint(t){for(const i of this.planes){const r=i[3];if(e.$.dot([i[0],i[1],i[2]],t)+r<0)return!1}return!0}}class Su{static fromPoints(t){const i=[1/0,1/0,1/0],r=[-1/0,-1/0,-1/0];for(const n of t)e.$.min(i,i,n),e.$.max(r,r,n);return new Su(i,r)}static fromTileIdAndHeight(e,t,i){const r=1<e.max[t]||e.min[t]>this.max[t])return!1;return!0}intersectsAabbXY(e){return!(this.min[0]>e.max[0]||e.min[0]>this.max[0]||this.min[1]>e.max[1]||e.min[1]>this.max[1])}encapsulate(e){for(let t=0;t<3;t++)this.min[t]=Math.min(this.min[t],e.min[t]),this.max[t]=Math.max(this.max[t],e.max[t])}encapsulatePoint(e){for(let t=0;t<3;t++)this.min[t]=Math.min(this.min[t],e[t]),this.max[t]=Math.max(this.max[t],e[t])}closestPoint(e){return[Math.max(Math.min(this.max[0],e[0]),this.min[0]),Math.max(Math.min(this.max[1],e[1]),this.min[1]),Math.max(Math.min(this.max[2],e[2]),this.min[2])]}}wa(Su,"Aabb");const Mu=zl([{type:"Float32",name:"a_globe_pos",components:3},{type:"Float32",name:"a_uv",components:2}]),{members:Au}=Mu,Iu=zl([{name:"a_pos_3",components:3,type:"Int16"}]);var Cu=zl([{name:"a_pos",type:"Int16",components:2}]);function Pu(e){return e*nh/fh}const zu=[new Su([hh,hh,hh],[uh,uh,uh]),new Su([hh,hh,hh],[0,0,uh]),new Su([0,hh,hh],[uh,0,uh]),new Su([hh,0,hh],[0,uh,uh]),new Su([0,0,hh],[uh,uh,uh])];function Du(t,i,r,n=!0){const o=e.$.scale([],t._camera.position,t.worldSize),s=[i,r,1,1];e.aB.transformMat4(s,s,t.pixelMatrixInverse),e.aB.scale(s,s,1/s[3]);const a=e.$.sub([],s,o),l=e.$.normalize([],a),c=t.globeMatrix,h=[c[12],c[13],c[14]],u=e.$.sub([],h,o),d=e.$.length(u),p=e.$.normalize([],u),f=t.worldSize/(2*Math.PI),m=e.$.dot(p,l),_=Math.asin(f/d);if(_1?null:(function(e,t,i,r){const n=Math.sin(i);return e*(Math.sin((1-r)*i)/n)+t*(Math.sin(r*i)/n)})(e.a[t],e.b[t],e.angle,Jt(i,0,1))+e.center[t]}function ku(e){if(e.z<=1)return zu[e.z+2*e.y+e.x];const t=Uu(Vu(e));return Su.fromPoints(t)}function Ou(t,i,r){return e.$.scale(t,t,1-r),e.$.scaleAndAdd(t,t,i,r)}function Bu(t,i){const r=Yu(i.zoom);if(0===r)return ku(t);const n=Vu(t),o=Uu(n),s=Ih(n.getWest())*i.worldSize,a=Ih(n.getEast())*i.worldSize,l=Ch(n.getNorth())*i.worldSize,c=Ch(n.getSouth())*i.worldSize,h=[s,l,0],u=[a,l,0],d=[s,c,0],p=[a,c,0],f=e.ae.invert([],i.globeMatrix);return e.$.transformMat4(h,h,f),e.$.transformMat4(u,u,f),e.$.transformMat4(d,d,f),e.$.transformMat4(p,p,f),o[0]=Ou(o[0],d,r),o[1]=Ou(o[1],p,r),o[2]=Ou(o[2],u,r),o[3]=Ou(o[3],h,r),Su.fromPoints(o)}function Fu(t,i,r){for(const n of t)e.$.transformMat4(n,n,i),e.$.scale(n,n,r)}function Nu(t,i,r,n){const o=i/t.worldSize,s=t.globeMatrix;if(r.z<=1){const e=ku(r).getCorners();return Fu(e,s,o),Su.fromPoints(e)}const a=Vu(r,n),l=Uu(a,nh+Pu(t._tileCoverLift));Fu(l,s,o);const c=Number.MAX_VALUE,h=[-c,-c,-c],u=[c,c,c];if(a.contains(t.center)){for(const t of l)e.$.min(u,u,t),e.$.max(h,h,t);h[2]=0;const i=t.point,r=[i.x*o,i.y*o,0];return e.$.min(u,u,r),e.$.max(h,h,r),new Su(u,h)}if(t._tileCoverLift>0){for(const t of l)e.$.min(u,u,t),e.$.max(h,h,t);return new Su(u,h)}const d=[s[12]*o,s[13]*o,s[14]*o],p=a.getCenter(),f=Jt(t.center.lat,-85.051129,Lh),m=Jt(p.lat,-85.051129,Lh),_=Ih(t.center.lng),g=Ch(f);let y=_-Ih(p.lng);const x=g-Ch(m);y>.5?y-=1:y<-.5&&(y+=1);let v=0;if(Math.abs(y)>Math.abs(x))v=y>=0?1:3;else{v=x>=0?0:2;const t=[s[4]*o,s[5]*o,s[6]*o],i=-Math.sin(qt(x>=0?a.getSouth():a.getNorth()))*nh;e.$.scaleAndAdd(d,d,t,i)}const b=l[v],w=l[(v+1)%4],T=new Ru(b,w,d),E=[Lu(T,0)||b[0],Lu(T,1)||b[1],Lu(T,2)||b[2]],S=Yu(t.zoom);if(S>0){const n=(function({x:e,y:t,z:i},r,n,o,s){const a=1/(1<.5?d=-1:p<-.5&&(d=1),l=((l+d)*r-(o*=r))*n+o,c=((c+d)*r-o)*n+o,h=(h*r-(s*=r))*n+s,u=(u*r-s)*n+s,[[l,u,0],[c,u,0],[c,h,0],[l,h,0]]})(r,i,t._pixelsPerMercatorPixel,_,g);for(let e=0;eMath.PI/2*1.01}const Qu=qt(85),ed=Math.cos(Qu),td=Math.sin(Qu),id=e.ae.create(),rd=e=>{const t=[];return"map"===e.paint.get("circle-pitch-alignment")&&t.push("PITCH_WITH_MAP"),"map"===e.paint.get("circle-pitch-scale")&&t.push("SCALE_WITH_MAP"),t};function nd(t,i,r,n,o,s,a,l,c){if(s&&t.queryGeometry.isAboveHorizon)return!1;s&&(c*=t.pixelToTileUnitsFactor);const h=t.tileID.canonical,u=r.projection.upVectorScale(h,r.center.lat,r.worldSize).metersToTile;for(const d of i)for(const i of d){const d=i.add(l),p=o&&r.elevation?r.elevation.exaggeration()*o.getElevationAt(d.x,d.y,!0):0,f=r.projection.projectTilePoint(d.x,d.y,h);if(p>0){const e=r.projection.upVector(h,d.x,d.y);f.x+=e[0]*u*p,f.y+=e[1]*u*p,f.z+=e[2]*u*p}const m=s?d:od(f.x,f.y,f.z,n),_=s?t.tilespaceRays.map((e=>ld(e,p))):t.queryGeometry.screenGeometry,g=e.aB.transformMat4([],[f.x,f.y,f.z,1],n);if(!a&&s?c*=g[3]/r.cameraToCenterDistance:a&&!s&&(c*=r.cameraToCenterDistance/g[3]),s){const e=Dh((i.y/uo+h.y)/(1<e.width||n.height>e.height||i.x>e.width-n.width||i.y>e.height-n.height)throw new RangeError("out of range source coordinates for image copy");if(n.width>t.width||n.height>t.height||r.x>t.width-n.width||r.y>t.height-n.height)throw new RangeError("out of range destination coordinates for image copy");const l=e.data,c=t.data,h=4===o&&a;for(let a=0;a{t[e.evaluationKey]=o;const s=e.expression.evaluate(t);s&&(n.data[i+r+0]=Math.floor(255*s.r/s.a),n.data[i+r+1]=Math.floor(255*s.g/s.a),n.data[i+r+2]=Math.floor(255*s.b/s.a),n.data[i+r+3]=Math.floor(255*s.a))};if(e.clips)for(let t=0,n=0;t80*i){a=1/0,l=1/0;let t=-1/0,r=-1/0;for(let o=i;ot&&(t=i),n>r&&(r=n)}c=Math.max(t-a,r-l),c=0!==c?32767/c:0}return Md(o,s,i,a,l,c,0),s}function Ed(e,t,i,r,n){let o;if(n===(function(e,t,i,r){let n=0;for(let o=t,s=i-r;o0)for(let n=t;n=t;n-=r)o=qd(n/r|0,e[n],e[n+1],o);return o&&Nd(o,o.next)&&(Zd(o),o=o.next),o}function Sd(e,t){if(!e)return e;t||(t=e);let i,r=e;do{if(i=!1,r.steiner||!Nd(r,r.next)&&0!==Fd(r.prev,r,r.next))r=r.next;else{if(Zd(r),r=t=r.prev,r===r.next)break;i=!0}}while(i||r!==t);return t}function Md(e,t,i,r,n,o,s){if(!e)return;!s&&o&&(function(e,t,i,r){let n=e;do{0===n.z&&(n.z=Ld(n.x,n.y,t,i,r)),n.prevZ=n.prev,n.nextZ=n.next,n=n.next}while(n!==e);n.prevZ.nextZ=null,n.prevZ=null,(function(e){let t,i=1;do{let r,n=e;e=null;let o=null;for(t=0;n;){t++;let s=n,a=0;for(let e=0;e0||l>0&&s;)0!==a&&(0===l||!s||n.z<=s.z)?(r=n,n=n.nextZ,a--):(r=s,s=s.nextZ,l--),o?o.nextZ=r:e=r,r.prevZ=o,o=r;n=s}o.nextZ=null,i*=2}while(t>1)})(n)})(e,r,n,o);let a=e;for(;e.prev!==e.next;){const l=e.prev,c=e.next;if(o?Id(e,r,n,o):Ad(e))t.push(l.i,e.i,c.i),Zd(e),e=c.next,a=c.next;else if((e=c)===a){s?1===s?Md(e=Cd(Sd(e),t),t,i,r,n,o,2):2===s&&Pd(e,t,i,r,n,o):Md(Sd(e),t,i,r,n,o,1);break}}}function Ad(e){const t=e.prev,i=e,r=e.next;if(Fd(t,i,r)>=0)return!1;const n=t.x,o=i.x,s=r.x,a=t.y,l=i.y,c=r.y,h=no?n>s?n:s:o>s?o:s,p=a>l?a>c?a:c:l>c?l:c;let f=r.next;for(;f!==t;){if(f.x>=h&&f.x<=d&&f.y>=u&&f.y<=p&&Od(n,a,o,l,s,c,f.x,f.y)&&Fd(f.prev,f,f.next)>=0)return!1;f=f.next}return!0}function Id(e,t,i,r){const n=e.prev,o=e,s=e.next;if(Fd(n,o,s)>=0)return!1;const a=n.x,l=o.x,c=s.x,h=n.y,u=o.y,d=s.y,p=al?a>c?a:c:l>c?l:c,_=h>u?h>d?h:d:u>d?u:d,g=Ld(p,f,t,i,r),y=Ld(m,_,t,i,r);let x=e.prevZ,v=e.nextZ;for(;x&&x.z>=g&&v&&v.z<=y;){if(x.x>=p&&x.x<=m&&x.y>=f&&x.y<=_&&x!==n&&x!==s&&Od(a,h,l,u,c,d,x.x,x.y)&&Fd(x.prev,x,x.next)>=0)return!1;if(x=x.prevZ,v.x>=p&&v.x<=m&&v.y>=f&&v.y<=_&&v!==n&&v!==s&&Od(a,h,l,u,c,d,v.x,v.y)&&Fd(v.prev,v,v.next)>=0)return!1;v=v.nextZ}for(;x&&x.z>=g;){if(x.x>=p&&x.x<=m&&x.y>=f&&x.y<=_&&x!==n&&x!==s&&Od(a,h,l,u,c,d,x.x,x.y)&&Fd(x.prev,x,x.next)>=0)return!1;x=x.prevZ}for(;v&&v.z<=y;){if(v.x>=p&&v.x<=m&&v.y>=f&&v.y<=_&&v!==n&&v!==s&&Od(a,h,l,u,c,d,v.x,v.y)&&Fd(v.prev,v,v.next)>=0)return!1;v=v.nextZ}return!0}function Cd(e,t){let i=e;do{const r=i.prev,n=i.next.next;!Nd(r,n)&&Vd(r,i,i.next,n)&&$d(r,n)&&$d(n,r)&&(t.push(r.i,i.i,n.i),Zd(i),Zd(i.next),i=e=n),i=i.next}while(i!==e);return Sd(i)}function Pd(e,t,i,r,n,o){let s=e;do{let e=s.next.next;for(;e!==s.prev;){if(s.i!==e.i&&Bd(s,e)){let a=Gd(s,e);return s=Sd(s,s.next),a=Sd(a,a.next),Md(s,t,i,r,n,o,0),void Md(a,t,i,r,n,o,0)}e=e.next}s=s.next}while(s!==e)}function zd(e,t){return e.x-t.x}function Dd(e,t){const i=(function(e,t){let i=t;const r=e.x,n=e.y;let o,s=-1/0;do{if(n<=i.y&&n>=i.next.y&&i.next.y!==i.y){const e=i.x+(n-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(e<=r&&e>s&&(s=e,o=i.x=i.x&&i.x>=l&&r!==i.x&&Od(no.x||i.x===o.x&&Rd(o,i)))&&(o=i,h=t)}i=i.next}while(i!==a);return o})(e,t);if(!i)return t;const r=Gd(i,e);return Sd(r,r.next),Sd(i,i.next)}function Rd(e,t){return Fd(e.prev,e,t.prev)<0&&Fd(t.next,e,e.next)<0}function Ld(e,t,i,r,n){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-i)*n|0)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-r)*n|0)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function kd(e){let t=e,i=e;do{(t.x=(e-s)*(o-a)&&(e-s)*(r-a)>=(i-s)*(t-a)&&(i-s)*(o-a)>=(n-s)*(r-a)}function Bd(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!(function(e,t){let i=e;do{if(i.i!==e.i&&i.next.i!==e.i&&i.i!==t.i&&i.next.i!==t.i&&Vd(i,i.next,e,t))return!0;i=i.next}while(i!==e);return!1})(e,t)&&($d(e,t)&&$d(t,e)&&(function(e,t){let i=e,r=!1;const n=(e.x+t.x)/2,o=(e.y+t.y)/2;do{i.y>o!=i.next.y>o&&i.next.y!==i.y&&n<(i.next.x-i.x)*(o-i.y)/(i.next.y-i.y)+i.x&&(r=!r),i=i.next}while(i!==e);return r})(e,t)&&(Fd(e.prev,e,t.prev)||Fd(e,t.prev,t))||Nd(e,t)&&Fd(e.prev,e,e.next)>0&&Fd(t.prev,t,t.next)>0)}function Fd(e,t,i){return(t.y-e.y)*(i.x-t.x)-(t.x-e.x)*(i.y-t.y)}function Nd(e,t){return e.x===t.x&&e.y===t.y}function Vd(e,t,i,r){const n=jd(Fd(e,t,i)),o=jd(Fd(e,t,r)),s=jd(Fd(i,r,e)),a=jd(Fd(i,r,t));return n!==o&&s!==a||!(0!==n||!Ud(e,i,t))||!(0!==o||!Ud(e,r,t))||!(0!==s||!Ud(i,e,r))||!(0!==a||!Ud(i,t,r))}function Ud(e,t,i){return t.x<=Math.max(e.x,i.x)&&t.x>=Math.min(e.x,i.x)&&t.y<=Math.max(e.y,i.y)&&t.y>=Math.min(e.y,i.y)}function jd(e){return e>0?1:e<0?-1:0}function $d(e,t){return Fd(e.prev,e,e.next)<0?Fd(e,t,e.next)>=0&&Fd(e,e.prev,t)>=0:Fd(e,t,e.prev)<0||Fd(e,e.next,t)<0}function Gd(e,t){const i=Wd(e.i,e.x,e.y),r=Wd(t.i,t.x,t.y),n=e.next,o=t.prev;return e.next=t,t.prev=e,i.next=n,n.prev=i,r.next=i,i.prev=r,o.next=r,r.prev=o,r}function qd(e,t,i,r){const n=Wd(e,t,i);return r?(n.next=r.next,n.prev=r,r.next.prev=n,r.next=n):(n.prev=n,n.next=n),n}function Zd(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function Wd(e,t,i){return{i:e,x:t,y:i,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function Hd(e,t){const i=e.length;if(i<=1)return[e];const r=[];let n,o;for(let t=0;t1)for(let e=0;ee.fqid)),this.index=e.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new Rl,this.indexArray=new Jl,this.indexArray2=new Zl,this.programConfigurations=new Kc(e.layers,{zoom:e.zoom,lut:e.lut}),this.segments=new Sc,this.segments2=new Sc,this.stateDependentLayerIds=this.layers.filter((e=>e.isStateDependent())).map((e=>e.id)),this.projection=e.projection}updateFootprints(e,t){}populate(e,t,i,r){this.hasPattern=Yd("fill",this.layers,t);const n=this.layers[0].layout.get("fill-sort-key"),o=[];for(const{feature:s,id:a,index:l,sourceLayerIndex:c}of e){const e=this.layers[0]._featureFilter.needGeometry,h=Hh(s,e);if(!this.layers[0]._featureFilter.filter(new Ha(this.zoom),h,i))continue;const u=n?n.evaluate(h,{},i,t.availableImages):void 0,d={id:a,properties:s.properties,type:s.type,sourceLayerIndex:c,index:l,geometry:e?h.geometry:Wh(s,i,r),patterns:{},sortKey:u};o.push(d)}n&&o.sort(((e,t)=>e.sortKey-t.sortKey));for(const r of o){const{geometry:n,index:o,sourceLayerIndex:s}=r;if(this.hasPattern){const e=Jd("fill",this.layers,r,this.zoom,t);this.patternFeatures.push(e)}else this.addFeature(r,n,o,i,{},t.availableImages,t.brightness);t.featureIndex.insert(e[o].feature,n,o,s,this.index)}}update(e,t,i,r,n){const o=0!==Object.keys(e).length;o&&!this.stateDependentLayers.length||this.programConfigurations.updatePaintArrays(e,t,o?this.stateDependentLayers:this.layers,i,r,n)}addFeatures(e,t,i,r,n,o){for(const e of this.patternFeatures)this.addFeature(e,e.geometry,e.index,t,i,r,o)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,wd),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.indexBuffer2=e.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())}addFeature(e,t,i,r,n,o=[],s){for(const e of Hd(t,500)){let t=0;for(const i of e)t+=i.length;const i=this.segments.prepareSegment(t,this.layoutVertexArray,this.indexArray),r=i.vertexLength,n=[],o=[];for(const t of e){if(0===t.length)continue;t!==e[0]&&o.push(n.length/2);const i=this.segments2.prepareSegment(t.length,this.layoutVertexArray,this.indexArray2),r=i.vertexLength;this.layoutVertexArray.emplaceBack(t[0].x,t[0].y),this.indexArray2.emplaceBack(r+t.length-1,r),n.push(t[0].x),n.push(t[0].y);for(let e=1;ee.cellIdx-t.cellIdx||e.triIdx-t.triIdx));let c=0;for(;cthis.max.x||this.min.x>e.x||e.y>this.max.y||this.min.y>e.y)return;const i=np(e.x-this.min.x,this.xScale,this.cellsX),r=np(e.y-this.min.y,this.yScale,this.cellsY),n=this.cells[r*this.cellsX+i];if(n){this._lazyInitLookup();for(let e=0;ethis.max.x||this.min.x>t.x)return;if(e.y>this.max.y||this.min.y>t.y)return;this._lazyInitLookup();const r=np(e.x-this.min.x,this.xScale,this.cellsX),n=np(t.x-this.min.x,this.xScale,this.cellsX),o=np(e.y-this.min.y,this.yScale,this.cellsY),s=np(t.y-this.min.y,this.yScale,this.cellsY);for(let e=o;e<=s;e++)for(let t=r;t<=n;t++){const r=this.cells[e*this.cellsX+t];if(r)for(let e=0;ee.fqid)),this.index=e.index,this.hasPattern=!1,this.stateDependentLayerIds=this.layers.filter((e=>e.isStateDependent())).map((e=>e.id)),this.footprints=[]}updateFootprints(e,t){for(const i of this.footprints)t.push({footprint:i,id:e})}populate(e,t,i,r){const n=[];for(const{feature:t,id:o,index:s,sourceLayerIndex:a}of e){const e=this.layers[0]._featureFilter.needGeometry,l=Hh(t,e);if(!this.layers[0]._featureFilter.filter(new Ha(this.zoom),l,i))continue;const c={id:o,properties:t.properties,type:t.type,sourceLayerIndex:a,index:s,geometry:e?l.geometry:Wh(t,i,r),patterns:{}};n.push(c)}for(const r of n){const{geometry:n,index:o,sourceLayerIndex:s}=r;this.addFeature(r,n,o,i,{},t.availableImages,t.brightness),t.featureIndex.insert(e[o].feature,n,o,s,this.index)}}isEmpty(){return 0===this.footprints.length}uploadPending(){return!1}upload(e){}update(e,t,i,r,n){}destroy(){}addFeature(e,t,i,r,n,o=[],s){for(const e of Hd(t,2)){const t=[],i=[],r=[],n=new Ut(1/0,1/0),o=new Ut(-1/0,-1/0);for(const s of e)if(0!==s.length){s!==e[0]&&r.push(i.length/2);for(let e=0;e>3}if(n--,1===r||2===r)o+=e.readSVarint(),s+=e.readSVarint(),1===r&&(t&&a.push(t),t=[]),t.push(new fp(o,s));else{if(7!==r)throw new Error("unknown command "+r);t&&t.push(t[0].clone())}}return t&&a.push(t),a},_p.prototype.bbox=function(){var e=this._pbf;e.pos=this._geometry;for(var t=e.readVarint()+e.pos,i=1,r=0,n=0,o=0,s=1/0,a=-1/0,l=1/0,c=-1/0;e.pos>3}if(r--,1===i||2===i)(n+=e.readSVarint())a&&(a=n),(o+=e.readSVarint())c&&(c=o);else if(7!==i)throw new Error("unknown command "+i)}return[s,l,a,c]},_p.prototype.toGeoJSON=function(e,t,i){var r,n,o=this.extent*Math.pow(2,i),s=this.extent*e,a=this.extent*t,l=this.loadGeometry(),c=_p.types[this.type];function h(e){for(var t=0;t>3;t=1===r?e.readString():2===r?e.readFloat():3===r?e.readDouble():4===r?e.readVarint64():5===r?e.readVarint():6===r?e.readSVarint():7===r?e.readBoolean():null}return t})(i))}bp.prototype.feature=function(e){if(e<0||e>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[e];var t=this._pbf.readVarint()+this._pbf.pos;return new xp(this._pbf,t,this.extent,this._keys,this._values)};var Tp=vp;function Ep(e,t,i){if(3===e){var r=new Tp(i,i.readVarint()+i.pos);r.length&&(t[r.name]=r)}}var Sp=pp.VectorTile=function(e,t){this.layers=e.readFields(Ep,{},t)},Mp=pp.VectorTileFeature=mp;pp.VectorTileLayer=vp;class Ap extends Ut{constructor(e,t,i){super(e,t),this.z=i}}class Ip extends Ap{constructor(e,t,i,r){super(e,t,i),this.w=r}}function Cp(e,t,i,r){const n=[],o=0===r?(e,t,i,r,n,o)=>{e.push(new Ut(o,i+(o-t)/(r-t)*(n-i)))}:(e,t,i,r,n,o)=>{e.push(new Ut(t+(o-i)/(n-i)*(r-t),o))};for(const s of e){const e=[];for(const n of s){if(n.length<=2)continue;const s=[];for(let e=0;et&&o(s,a,l,c,h,t):u>i?d=t&&o(s,a,l,c,h,t),d>i&&u<=i&&o(s,a,l,c,h,i)}let a=n[n.length-1];const l=0===r?a.x:a.y;l>=t&&l<=i&&s.push(a),s.length&&(a=s[s.length-1],s[0].x===a.x&&s[0].y===a.y||s.push(s[0]),e.push(s))}e.length&&n.push(e)}return n}function Pp(e,t,i,r){const n="x"===i?"y":"x",o=(r-e[i])/(t[i]-e[i]);e[n]=e[n]+(t[n]-e[n])*o,e[i]=r,e.hasOwnProperty("z")&&(e.z=qr(e.z,t.z,o)),e.hasOwnProperty("w")&&(e.w=qr(e.w,t.w,o))}function zp(e,t,i,r){const n=i,o=r;for(const i of["x","y"]){let r=e,s=t;r[i]>=s[i]&&(r=t,s=e),r[i]n&&Pp(r,s,i,n),r[i]o&&Pp(s,r,i,o)}}const Dp=Number.MAX_SAFE_INTEGER;function Rp(e,t,i,r){return e.ordert===e))})(r,e.clipScope)}function Lp(e,t){return e.x-t.x||e.y-t.y}function kp(e,t){return 0===Lp(e.min,t.min)&&0===Lp(e.max,t.max)}function Op(e,t){return!(e.min.x>t.max.x||e.max.xt.max.y||e.max.ynew Ut((e.x+o.x*uo)*a-s.x*uo,(e.y+o.y*uo)*a-s.y*uo)))}return Vp(i,n,e.indices,0,e.indices.length,0,0)}function jp(e,t,i,r){const n=Math.pow(2,r.z-i.z);return new Ut((e+i.x*uo)*n-r.x*uo,(t+i.y*uo)*n-r.y*uo)}function $p(e,t){const i=[];t.footprint.grid.queryPoint(e,i);const r=t.footprint.indices,n=t.footprint.vertices;for(let t=0;tt[s])return null}else{const a=1/r[s];let l=(e[s]-i[s])*a,c=(t[s]-i[s])*a;if(l>c){const e=l;l=c,c=e}if(l>n&&(n=l),co)return null}return n}function Zp(e,t,i,r,n,o,s,a,l,c,h){const u=r-e,d=n-t,p=o-i,f=s-e,m=a-t,_=l-i,g=h[1]*_-h[2]*m,y=h[2]*f-h[0]*_,x=h[0]*m-h[1]*f,v=u*g+d*y+p*x;if(Math.abs(v)<1e-15)return null;const b=1/v,w=c[0]-e,T=c[1]-t,E=c[2]-i,S=(w*g+T*y+E*x)*b;if(S<0||S>1)return null;const M=T*p-E*d,A=E*u-w*p,I=w*d-T*u,C=(h[0]*M+h[1]*A+h[2]*I)*b;return C<0||S+C>1?null:(f*M+m*A+_*I)*b}function Wp(e,t,i){return(e-t)/(i-t)}function Hp(e,t,i,r,n,o,s,a,l){const c=1<{const o=r?1:0,s=(e+1)*i-o,a=t*i,l=(t+1)*i-o;n[0]=e*i,n[1]=a,n[2]=s,n[3]=l};let s=new Gp(r);const a=[];for(let t=0;t=1;r/=2){const e=i[i.length-1];s=new Gp(r);for(let t=0;t0;){const{idx:l,t:f,nodex:m,nodey:_,depth:g}=p.pop();if(this.leaves[l]){Hp(m,_,g,t,i,r,n,u,d);const l=1<=t[2])return f}continue}let y=0;for(let e=0;e=c[h[r]]&&(h.splice(r,0,e),i=!0);i||(h[y]=e),y++}}for(let e=0;e=this.dim+1||t<-1||t>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(t+1)*this.stride+(e+1)}static pack(e,t){const i=[0,0,0,0],r=tf.getUnpackVector(t);let n=Math.floor((e+r[3])/r[2]);return i[2]=n%256,n=Math.floor(n/256),i[1]=n%256,n=Math.floor(n/256),i[0]=n,i}getPixels(){return new md({width:this.stride,height:this.stride},this.pixels)}backfillBorder(e,t,i){if(this.dim!==e.dim)throw new Error("dem dimension mismatch");let r=t*this.dim,n=t*this.dim+this.dim,o=i*this.dim,s=i*this.dim+this.dim;switch(t){case-1:r=n-1;break;case 1:n=r+1}switch(i){case-1:o=s-1;break;case 1:s=o+1}const a=-t*this.dim,l=-i*this.dim;for(let t=o;te.max.x&&(e.max.x=t.x,r=!0),t.ye.max.y&&(e.max.y=t.y,r=!0),((0===t.x||t.x===uo)&&t.x===i.x)!=((0===t.y||t.y===uo)&&t.y===i.y)&&this.processBorderOverlap(t,i),r&&this.checkBorderIntersection(t,i)}checkBorderIntersection(e,t){t.x<0!=e.x<0&&this.addBorderIntersection(0,qr(t.y,e.y,(0-t.x)/(e.x-t.x))),t.x>uo!=e.x>uo&&this.addBorderIntersection(1,qr(t.y,e.y,(uo-t.x)/(e.x-t.x))),t.y<0!=e.y<0&&this.addBorderIntersection(2,qr(t.x,e.x,(0-t.y)/(e.y-t.y))),t.y>uo!=e.y>uo&&this.addBorderIntersection(3,qr(t.x,e.x,(uo-t.y)/(e.y-t.y)))}addBorderIntersection(e,t){this.borders||(this.borders=[[Number.MAX_VALUE,-Number.MAX_VALUE],[Number.MAX_VALUE,-Number.MAX_VALUE],[Number.MAX_VALUE,-Number.MAX_VALUE],[Number.MAX_VALUE,-Number.MAX_VALUE]]);const i=this.borders[e];ti[1]&&(i[1]=t)}processBorderOverlap(e,t){if(e.x===t.x){if(e.y===t.y)return;const i=0===e.x?0:1;this.addBorderIntersection(i,t.y),this.addBorderIntersection(i,e.y)}else{const i=0===e.y?2:3;this.addBorderIntersection(i,t.x),this.addBorderIntersection(i,e.x)}}centroid(){return 0===this.accCount?new Ut(0,0):new Ut(Math.floor(Math.max(0,this.acc.x)/this.accCount),Math.floor(Math.max(0,this.acc.y)/this.accCount))}intersectsCount(){return this.borders?this.borders.reduce(((e,t)=>e+ +(t[0]!==Number.MAX_VALUE)),0):0}}function xf(e,t){const i=e.add(t)._unit(),r=Jt(e.x*i.x+e.y*i.y,-1,1);var n,o,s;return n=Math.acos(r),Math.min(4,Math.max(-4,Math.tan(n)))/4*cf*((o=e).x*(s=t).y-o.y*s.x<0?-1:1)}const vf=[e=>e.x<0,e=>e.x>uo,e=>e.y<0,e=>e.y>uo];function bf(e,t,i,r){const n=[4];if(0===r)return n;i._mult(r);const o=e.sub(i),s=t.sub(i),a=[e,t,o,s];for(let e=0;e<4;e++)for(const t of a)if(vf[e](t)){n.push(e);break}return n}class wf{constructor(e){this.vertexArray=new Ol,this.indexArray=new Jl,this.programConfigurations=new Kc(e.layers,{zoom:e.zoom,lut:e.lut},(e=>af.includes(e))),this._segments=new Sc,this.hiddenByLandmarkVertexArray=new cc,this._segmentToGroundQuads={},this._segmentToGroundQuads[0]=[],this._segmentToRegionTriCounts={},this._segmentToRegionTriCounts[0]=[0,0,0,0,0],this.regionSegments={},this.regionSegments[4]=new Sc}getDefaultSegment(){return this.regionSegments[4]}hasData(){return 0!==this.vertexArray.length}addData(e,t,i,r=!1){const n=e.length;if(n>2){let o=Math.max(0,this._segments.get().length-1);const s=this._segments._prepareSegment(4*n,this.vertexArray.length,2*this._segmentToGroundQuads[o].length);let a;o!==this._segments.get().length-1&&(o++,this._segmentToGroundQuads[o]=[],this._segmentToRegionTriCounts[o]=[0,0,0,0,0]);{const t=e[0],i=e[1];a=xf(t.sub(e[n-1])._perp()._unit(),i.sub(t)._perp()._unit())}for(let l=0;le.region-t.region));for(let i=0;ie+t),0);let o=0;for(let e=0;e<=4;e++){const t=n[e];if(0!==t){let i=this.regionSegments[e];i||(i=this.regionSegments[e]=new Sc);const n={vertexOffset:r.vertexOffset,primitiveOffset:r.primitiveOffset+o,vertexLength:r.vertexLength,primitiveLength:t};i.get().push(n)}o+=t}for(let e=0;e0?this.hiddenByLandmarkVertexBuffer=e.createVertexBuffer(this.hiddenByLandmarkVertexArray,hp.members,!0):this.hiddenByLandmarkVertexBuffer&&this.hiddenByLandmarkVertexBuffer.updateData(this.hiddenByLandmarkVertexArray),this._needsHiddenByLandmarkUpdate=!1)}destroy(){if(this.vertexBuffer){this.vertexBuffer.destroy(),this.indexBuffer.destroy(),this.hiddenByLandmarkVertexBuffer&&this.hiddenByLandmarkVertexBuffer.destroy(),this._segments&&this._segments.destroy(),this.programConfigurations.destroy();for(let e=0;e<=4;e++){const t=this.regionSegments[e];t&&t.destroy()}}}}class Tf{constructor(e){this.zoom=e.zoom,this.canonical=e.canonical,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((e=>e.fqid)),this.index=e.index,this.hasPattern=!1,this.edgeRadius=0,this.projection=e.projection,this.activeReplacements=[],this.replacementUpdateTime=0,this.centroidData=[],this.footprintIndices=new Jl,this.footprintVertices=new Rl,this.footprintSegments=[],this.layoutVertexArray=new kl,this.centroidVertexArray=new vc,this.wallVertexArray=new wc,this.indexArray=new Jl,this.programConfigurations=new Kc(e.layers,{zoom:e.zoom,lut:e.lut},(e=>sf.includes(e))),this.segments=new Sc,this.stateDependentLayerIds=this.layers.filter((e=>e.isStateDependent())).map((e=>e.id)),this.groundEffect=new wf(e),this.maxHeight=0,this.partLookup={},this.triangleSubSegments=[],this.polygonSegments=[]}updateFootprints(e,t){}populate(e,t,i,r){this.features=[],this.hasPattern=Yd("fill-extrusion",this.layers,t),this.featuresOnBorder=[],this.borderFeatureIndices=[[],[],[],[]],this.borderDoneWithNeighborZ=[-1,-1,-1,-1],this.tileToMeter=Fh(i),this.edgeRadius=this.layers[0].layout.get("fill-extrusion-edge-radius")/this.tileToMeter,this.wallMode=0!==this.layers[0].paint.get("fill-extrusion-line-width").constantOr(1);for(const{feature:n,id:o,index:s,sourceLayerIndex:a}of e){const e=this.layers[0]._featureFilter.needGeometry,l=Hh(n,e);if(!this.layers[0]._featureFilter.filter(new Ha(this.zoom),l,i))continue;const c={id:o,sourceLayerIndex:a,index:s,geometry:e?l.geometry:Wh(n,i,r),properties:n.properties,type:n.type,patterns:{}},h=this.layoutVertexArray.length;if(this.hasPattern)this.features.push(Jd("fill-extrusion",this.layers,c,this.zoom,t));else if(this.wallMode)for(const e of c.geometry)this.addFeature(c,[e],s,i,{},t.availableImages,r,t.brightness);else this.addFeature(c,c.geometry,s,i,{},t.availableImages,r,t.brightness);t.featureIndex.insert(n,c.geometry,s,a,this.index,h)}this.sortBorders(),"mercator"===this.projection.name&&this.splitToSubtiles(),this.groundEffect.prepareBorderSegments(),this.polygonSegments.length=0}addFeatures(e,t,i,r,n,o){for(const e of this.features){const{geometry:s}=e;if(this.wallMode)for(const a of s)this.addFeature(e,[a],e.index,t,i,r,n,o);else this.addFeature(e,s,e.index,t,i,r,n,o)}this.sortBorders(),"mercator"===this.projection.name&&this.splitToSubtiles()}update(e,t,i,r,n){const o=0!==Object.keys(e).length;if(o&&!this.stateDependentLayers.length)return;const s=o?this.stateDependentLayers:this.layers;this.programConfigurations.updatePaintArrays(e,t,s,i,r,n),this.groundEffect.update(e,t,s,i,r,n)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload||this.groundEffect.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,dp),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.wallVertexBuffer=e.createVertexBuffer(this.wallVertexArray,cp.members),this.layoutVertexExtArray&&(this.layoutVertexExtBuffer=e.createVertexBuffer(this.layoutVertexExtArray,up.members,!0)),this.groundEffect.upload(e)),this.groundEffect.uploadPaintProperties(e),this.programConfigurations.upload(e),this.uploaded=!0}uploadCentroid(e){this.groundEffect.uploadHiddenByLandmark(e),this.needsCentroidUpdate&&(!this.centroidVertexBuffer&&this.centroidVertexArray.length>0?this.centroidVertexBuffer=e.createVertexBuffer(this.centroidVertexArray,lp.members,!0):this.centroidVertexBuffer&&this.centroidVertexBuffer.updateData(this.centroidVertexArray),this.needsCentroidUpdate=!1)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.centroidVertexBuffer&&this.centroidVertexBuffer.destroy(),this.layoutVertexExtBuffer&&this.layoutVertexExtBuffer.destroy(),this.groundEffect.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(e,t,i,r,n,o,s,a){const l=this.layers[0].paint.get("fill-extrusion-flood-light-ground-radius").evaluate(e,{})/this.tileToMeter,c=[new Ut(0,0),new Ut(uo,uo)],h=s.projection,u="globe"===h.name,d=this.wallMode||"Polygon"===of[e.type],p=new yf;p.centroidDataIndex=this.centroidData.length;const f=new gf,m=this.layers[0].paint.get("fill-extrusion-base").evaluate(e,{},r)<=0,_=this.layers[0].paint.get("fill-extrusion-height").evaluate(e,{},r);let g;if(f.height=_,f.vertexArrayOffset=this.layoutVertexArray.length,f.groundVertexArrayOffset=this.groundEffect.vertexArray.length,u&&!this.layoutVertexExtArray&&(this.layoutVertexExtArray=new jl),this.wallMode){if(u)return void fi("Non zero fill-extrusion-line-width is not yet supported on globe.");if(1!==t.length)return;g=(function(e){const t=e[0].x===e[e.length-1].x&&e[0].y===e[e.length-1].y,i=(function(e){let t=0;const i=e.length;for(let r=0;r=0})(e);i||(e=e.reverse());const r={isPolygon:t,geometry:[],joinNormals:[]},n=[],o=[],s=[];let a=e.length;if(a<(t?3:2))return r;for(;a>=2&&e[a-1].equals(e[a-2]);)a--;let l,c,h,u,d,p=0;for(;p0;let g="miter";"miter"===g&&m>2&&(g="bevel");const y=(e,t,i,r)=>{const a=new Ut(e.x,e.y),l=new Ut(e.x,e.y);a.x-=t.x*r,a.y-=t.y*r,l.x-=t.x*Math.max(i,1),l.y-=t.y*Math.max(i,1),s.push(t),n.push(a),o.push(l)};if("miter"===g)r._mult(m),y(l,r,1,0);else{const e=-Math.sqrt(m*m-1),t=_?e:0,i=_?0:e;c&&y(l,u,t,i),h&&y(l,d,t,i)}}return r.geometry=[...n,...o.reverse(),n[0]],r.joinNormals=[...s,...s.reverse(),s[s.length-1]],r})(t[0]),t=[g.geometry]}const y=(e,t)=>e<(t.length-1)/2||e===t.length-1,x=this.wallMode?[t]:Hd(t,500);for(let e=x.length-1;e>=0;e--){const t=x[e];(0===t.length||(v=t[0]).every((e=>e.x<=0))||v.every((e=>e.x>=uo))||v.every((e=>e.y<=0))||v.every((e=>e.y>=uo)))&&x.splice(e,1)}var v;let b;if(u)b=Df(x,c,r);else{b=[];for(const e of x)b.push({polygon:e,bounds:c})}const w=d?this.edgeRadius:0,T=w>0&&this.zoom<17,E=(e,t)=>{if(0===e.length)return!1;const i=e[e.length-1];return t.x===i.x&&t.y===i.y};for(const{polygon:e,bounds:t}of b){let i=0,n=0;for(const t of e)d&&!t[0].equals(t[t.length-1])&&t.push(t[0]),n+=d?t.length-1:t.length;const o=this.segments.prepareSegment((d?5:4)*n,this.layoutVertexArray,this.indexArray);f.footprintSegIdx<0&&(f.footprintSegIdx=this.footprintSegments.length),f.polygonSegIdx<0&&(f.polygonSegIdx=this.polygonSegments.length);const s={triangleArrayOffset:this.indexArray.length,triangleCount:0,triangleSegIdx:this.segments.segments.length-1},a=new _f;if(a.vertexOffset=this.footprintVertices.length,a.indexOffset=3*this.footprintIndices.length,a.ringIndices=[],d){const n=[],s=[];i=o.vertexLength;for(let i=0;i4&&Cf(s[s.length-2],s[0],s[1]),c=w?Sf(s[s.length-2],s[0],s[1],w):0;const _=[];let x,v,b;v=s[1].sub(s[0])._perp()._unit();let T=!0;for(let e=1,n=0;e0?1:0,C=l.dist(d);if(n+C>32768&&(n=0),w){b=S.sub(d)._perp()._unit();let e=Mf(l,d,S,Ef(v,b),w);isNaN(e)&&(e=0);const t=d.sub(l)._unit();l=l.add(t.mult(c))._round(),d=d.add(t.mult(-e))._round(),c=e,v=b,m&&this.zoom>=17&&(E(_,l)||_.push(l),E(_,d)||_.push(d))}const P=o.vertexLength,z=s.length>4&&Cf(l,d,S);let D=Pf(n,a,T);if(df(this.layoutVertexArray,l.x,l.y,A,I,0,0,D),df(this.layoutVertexArray,l.x,l.y,A,I,0,1,D),this.wallMode){const t=y(e-1,s),i=g.joinNormals[e-1];pf(this.wallVertexArray,i,!t,g.isPolygon),pf(this.wallVertexArray,i,!t,g.isPolygon)}if(n+=C,D=Pf(n,z,!T),a=z,df(this.layoutVertexArray,d.x,d.y,A,I,0,0,D),df(this.layoutVertexArray,d.x,d.y,A,I,0,1,D),this.wallMode){const t=y(e,s),i=g.joinNormals[e];pf(this.wallVertexArray,i,!t,g.isPolygon),pf(this.wallVertexArray,i,!t,g.isPolygon)}if(o.vertexLength+=4,this.indexArray.emplaceBack(P+0,P+1,P+2),this.indexArray.emplaceBack(P+1,P+3,P+2),o.primitiveLength+=2,w){const r=i+(1===e?s.length-2:e-2),n=1===e?i:r+1;if(this.indexArray.emplaceBack(P+1,r,P+3),this.indexArray.emplaceBack(r,n,P+3),o.primitiveLength+=2,void 0===x&&(x=P),!Af(S,s[e],t)){const t=e===s.length-1?x:o.vertexLength;this.indexArray.emplaceBack(P+2,P+3,t),this.indexArray.emplaceBack(P+3,t+1,t),this.indexArray.emplaceBack(P+3,n,t+1),o.primitiveLength+=3}T=!T}if(u){const e=this.layoutVertexExtArray,t=h.projectTilePoint(l.x,l.y,r),i=h.projectTilePoint(d.x,d.y,r),n=h.upVector(r,l.x,l.y),o=h.upVector(r,d.x,d.y);mf(e,t,n),mf(e,t,n),mf(e,i,o),mf(e,i,o)}}d&&(i+=s.length-1),m&&w&&this.zoom>=17&&(0!==_.length&&E(_,_[0])&&_.pop(),this.groundEffect.addData(_,t,l,w>0))}this.footprintSegments.push(a),s.triangleCount=this.indexArray.length-s.triangleArrayOffset,this.polygonSegments.push(s),++f.footprintSegLen,++f.polygonSegLen}if(f.vertexCount=this.layoutVertexArray.length-f.vertexArrayOffset,f.groundVertexCount=this.groundEffect.vertexArray.length-f.groundVertexArrayOffset,0!==f.vertexCount){if(f.centroidXY=p.borders?hf:this.encodeCentroid(p,f),this.centroidData.push(f),p.borders){this.featuresOnBorder.push(p);const e=this.featuresOnBorder.length-1;for(let t=0;tthis.featuresOnBorder[t].borders[e][0]-this.featuresOnBorder[i].borders[e][0]))}splitToSubtiles(){const e=[];for(let t=0;tuo),n=2*r+(+(i.min.x+i.max.x>uo)^r);for(let r=0;re.triangleSegmentIdx===t.triangleSegmentIdx?e.subtile-t.subtile:e.triangleSegmentIdx-t.triangleSegmentIdx));let i=0,r=0,n=0;for(const t of e){if(t.triangleSegmentIdx!==i)break;n++}const o=e.length;for(;r!==e.length;){i=e[r].triangleSegmentIdx;let s=0,a=r,l=r;for(let t=a;t0&&this.triangleSubSegments.push({segment:h,min:o,max:c}),a=l;for(let t=a;t[e[0]*(1-i[0])+t[0]*i[0],e[1]*(1-i[1])+t[1]*i[1]],d=[],p=[];for(const e of this.triangleSubSegments){d[0]=e.min.x/uo,d[1]=e.min.y/uo,p[0]=e.max.x/uo,p[1]=e.max.y/uo;const t=u(c,h,d),s=u(c,h,p);if(0===new Su([t[0],t[1],n],[s[0],s[1],o]).intersectsPrecise(i)){l&&(r.segments.push(l),l=void 0);continue}const a=e.segment;l&&l.vertexOffset!==a.vertexOffset&&(r.segments.push(l),l=void 0),l?(l.vertexLength+=a.vertexLength,l.primitiveLength+=a.primitiveLength):l={vertexOffset:a.vertexOffset,primitiveLength:a.primitiveLength,vertexLength:a.vertexLength,primitiveOffset:a.primitiveOffset,sortKey:void 0,vaos:{}}}return l&&r.segments.push(l),r}encodeCentroid(e,t){const i=e.centroid(),r=t.span(),n=Math.min(7,Math.round(r.x*this.tileToMeter/10)),o=Math.min(7,Math.round(r.y*this.tileToMeter/10));return new Ut(Jt(i.x,1,8191)<<3|n,Jt(i.y,1,8191)<<3|o)}encodeBorderCentroid(e){if(!e.borders)return new Ut(0,0);const t=e.borders,i=Number.MAX_VALUE;if(t[0][0]!==i||t[1][0]!==i){const e=t[0][0]!==i?0:1;return new Ut(6|(t[0][0]!==i?0:65528),(t[e][0]+t[e][1])/2<<3|6)}{const e=t[2][0]!==i?2:3;return new Ut((t[e][0]+t[e][1])/2<<3|6,6|(t[2][0]!==i?0:65528))}}showCentroid(e){const t=this.centroidData[e.centroidDataIndex];t.flags&=uf,t.centroidXY.x=0,t.centroidXY.y=0,this.writeCentroidToBuffer(t)}writeCentroidToBuffer(e){this.groundEffect.updateHiddenByLandmark(e);const t=e.vertexArrayOffset,i=e.vertexCount+e.vertexArrayOffset,r=e.flags&uf?hf:e.centroidXY,n=this.centroidVertexArray.geta_centroid_pos0(t);if(this.centroidVertexArray.geta_centroid_pos1(t)!==r.y||n!==r.x){for(let e=t;ei.max.x||i.min.x>t.max.x||t.min.y>i.max.y||i.min.y>t.max.y))for(let o=0;ot!=l>t&&e<(this.footprintVertices.int16[2*(a+o.vertexOffset)+0]-i)*(t-s)/(l-s)+i&&(r=!r)}s=i}}return r}getHeightAtTileCoord(e,t){let i=Number.NEGATIVE_INFINITY,r=!0;const n=4*(e+uo)*uo+(t+uo);if(this.partLookup.hasOwnProperty(n)){const e=this.partLookup[n];return e?{height:e.height,hidden:!!(e.flags&uf)}:void 0}for(const o of this.centroidData)e>o.max.x||o.min.x>e||t>o.max.y||o.min.y>t||this.footprintContainsPoint(e,t,o)&&o&&o.height>i&&(i=o.height,this.partLookup[n]=o,r=!!(o.flags&uf));if(i!==Number.NEGATIVE_INFINITY)return{height:i,hidden:r};this.partLookup[n]=void 0}}function Ef(e,t){const i=e.add(t)._unit();return e.x*i.x+e.y*i.y}function Sf(e,t,i,r){const n=t.sub(e)._perp()._unit(),o=i.sub(t)._perp()._unit();return Mf(e,t,i,Ef(n,o),r)}function Mf(e,t,i,r,n){const o=Math.sqrt(1-r*r);return Math.min(e.dist(t)/3,t.dist(i)/3,n*o/r)}function Af(e,t,i){return e.xi[1].x&&t.x>i[1].x||e.yi[1].y&&t.y>i[1].y}function If(e,t){return e.xt[1].x||e.yt[1].y}function Cf(e,t,i){if(e.x<0||e.x>=uo||t.x<0||t.x>=uo||i.x<0||i.x>=uo)return!1;const r=i.sub(t),n=r.perp(),o=e.sub(t);return(r.x*o.x+r.y*o.y)/Math.sqrt((r.x*r.x+r.y*r.y)*(o.x*o.x+o.y*o.y))>-.866&&n.x*o.x+n.y*o.y<0}function Pf(e,t,i){const r=t?2|e:-3&e;return i?1|r:-2&r}function zf(){const e=Math.PI/32,t=Math.tan(e),i=fh;return i*Math.sqrt(1+2*t*t)-i}function Df(e,t,i){const r=1<{for(const i of e)s.push({polygon:i,bounds:t})},l=Math.ceil(Math.log2(i)),c=Math.ceil(Math.log2(r)),h=l-c,u=[];for(let e=0;e0?0:1);for(let e=0;et+1?p.push({polygons:d,bounds:e,depth:t+1}):a(d,e)}if(f.length){const e=[new Ut(0===i?h:r.x,1===i?h:r.y),s];u.length>t+1?p.push({polygons:f,bounds:e,depth:t+1}):a(f,e)}}return s})(e,t,Math.ceil((o-n)/11.25),Math.ceil((s-a)/11.25),1,((e,t,n)=>{if(0===e)return.5*(t+n);{const e=Dh((i.y+t/uo)/r);return(Ch(.5*(Dh((i.y+n/uo)/r)+e))*r-i.y)*uo}}))}function Rf(e,t,i,r,n,o){const s=Math.pow(2,r.z-n.z);for(let a=0;a1&&(s=e[++o]);const l=Math.abs(a-s.left),c=Math.abs(a-s.right),h=Math.min(l,c);let u;const d=t/i*(r+1);if(s.isDash){const e=r-Math.abs(d);u=Math.sqrt(h*h+e*e)}else u=r-Math.sqrt(h*h+d*d);this.image.data[n+a]=Math.max(0,Math.min(255,u+128))}}}addRegularDash(e,t){for(let t=e.length-1;t>=0;--t){const i=e[t],r=e[t+1];i.zeroLength?e.splice(t,1):r&&r.isDash===i.isDash&&(r.left=i.left,e.splice(t,1))}const i=e[0],r=e[e.length-1];i.isDash===r.isDash&&(i.left=r.left-this.width,r.right=i.right+this.width);const n=this.width*this.nextRow;let o=0,s=e[o];for(let i=0;i1&&(s=e[++o]);const r=Math.abs(i-s.left),a=Math.abs(i-s.right),l=Math.min(r,a);this.image.data[n+i]=Math.max(0,Math.min(255,(s.isDash?l:-l)+t+128))}}addDash(e,t){const i=this.getKey(e,t);if(this.positions[i])return this.positions[i];const r="round"===t,n=r?7:0,o=2*n+1;if(this.nextRow+o>this.height)return fi("LineAtlas out of space"),null;0===e.length&&e.push(1);let s=0;for(let t=0;te.fqid)),this.index=e.index,this.projection=e.projection,this.hasPattern=!1,this.hasZOffset=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach((e=>{this.gradients[e.id]={}})),this.layoutVertexArray=new Bl,this.layoutVertexArray2=new Fl,this.patternVertexArray=new Nl,this.indexArray=new Jl,this.programConfigurations=new Kc(e.layers,{zoom:e.zoom,lut:e.lut}),this.segments=new Sc,this.maxLineLength=0,this.zOffsetVertexArray=new ec,this.stateDependentLayerIds=this.layers.filter((e=>e.isStateDependent())).map((e=>e.id)),this.tessellationStep=e.tessellationStep?e.tessellationStep:128}updateFootprints(e,t){}populate(e,t,i,r){this.hasPattern=Yd("line",this.layers,t);const n=this.layers[0].layout.get("line-sort-key"),o=this.layers[0].layout.get("line-z-offset");this.hasZOffset=!o.isConstant()||!!o.constantOr(0);const s=[];for(const{feature:t,id:o,index:a,sourceLayerIndex:l}of e){const e=this.layers[0]._featureFilter.needGeometry,c=Hh(t,e);if(!this.layers[0]._featureFilter.filter(new Ha(this.zoom),c,i))continue;const h=n?n.evaluate(c,{},i):void 0,u={id:o,properties:t.properties,type:t.type,sourceLayerIndex:l,index:a,geometry:e?c.geometry:Wh(t,i,r),patterns:{},sortKey:h};s.push(u)}n&&s.sort(((e,t)=>e.sortKey-t.sortKey));const{lineAtlas:a,featureIndex:l}=t,c=this.addConstantDashes(a);for(const r of s){const{geometry:n,index:o,sourceLayerIndex:s}=r;if(c&&this.addFeatureDashes(r,a),this.hasPattern){const e=Jd("line",this.layers,r,this.zoom,t);this.patternFeatures.push(e)}else this.addFeature(r,n,o,i,a.positions,t.availableImages,t.brightness);l.insert(e[o].feature,n,o,s,this.index)}}addConstantDashes(e){let t=!1;for(const i of this.layers){const r=i.paint.get("line-dasharray").value,n=i.layout.get("line-cap").value;if("constant"!==r.kind||"constant"!==n.kind)t=!0;else{const t=n.value,i=r.value;if(!i)continue;e.addDash(i,t)}}return t}addFeatureDashes(e,t){const i=this.zoom;for(const r of this.layers){const n=r.paint.get("line-dasharray").value,o=r.layout.get("line-cap").value;if("constant"===n.kind&&"constant"===o.kind)continue;let s,a;if("constant"===n.kind){if(s=n.value,!s)continue}else s=n.evaluate({zoom:i},e);a="constant"===o.kind?o.value:o.evaluate({zoom:i},e),t.addDash(s,a),e.patterns[r.id]=t.getKey(s,a)}}update(e,t,i,r,n){const o=0!==Object.keys(e).length;o&&!this.stateDependentLayers.length||this.programConfigurations.updatePaintArrays(e,t,o?this.stateDependentLayers:this.layers,i,r,n)}addFeatures(e,t,i,r,n,o){for(const e of this.patternFeatures)this.addFeature(e,e.geometry,e.index,t,i,r,o)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(0!==this.layoutVertexArray2.length&&(this.layoutVertexBuffer2=e.createVertexBuffer(this.layoutVertexArray2,jf)),0!==this.patternVertexArray.length&&(this.patternVertexBuffer=e.createVertexBuffer(this.patternVertexArray,Gf)),!this.zOffsetVertexBuffer&&this.zOffsetVertexArray.length>0&&(this.zOffsetVertexBuffer=e.createVertexBuffer(this.zOffsetVertexArray,Hf.members,!0)),this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Vf),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.zOffsetVertexBuffer&&this.zOffsetVertexBuffer.destroy(),this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(e){if(e.properties&&e.properties.hasOwnProperty("mapbox_clip_start")&&e.properties.hasOwnProperty("mapbox_clip_end"))return{start:+e.properties.mapbox_clip_start,end:+e.properties.mapbox_clip_end}}addFeature(e,t,i,r,n,o,s){const a=this.layers[0].layout,l=a.get("line-join").evaluate(e,{}),c=a.get("line-cap").evaluate(e,{}),h=a.get("line-miter-limit"),u=a.get("line-round-limit");this.lineClips=this.lineFeatureClips(e);for(const i of t)this.addLine(i,e,r,l,c,h,u);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,i,n,o,r,s)}addLine(e,t,i,r,n,o,s){this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineSoFar=0,this.currentVertex=void 0;const a={zoom:this.zoom,lineProgress:void 0},l=this.layers[0].layout,c="none"===r;if(this.patternJoinNone=this.hasPattern&&c,this.segmentStart=0,this.segmentStartf32=0,this.segmentPoints=[],this.lineClips){this.lineClipsArray.push(this.lineClips);for(let t=0;t=2&&e[u-1].equals(e[u-2]);)u--;let d=0;for(;d0;if(I&&i>d){const e=m.dist(_);if(e>2*p){const t=m.sub(m.sub(_)._mult(p/e)._round());this.updateDistance(_,t),this.addCurrentVertex(t,y,0,0,f,v),_=t}}if(b&&"round"===w&&(Mo&&(w="bevel"),"bevel"===w&&(M>2&&(w="flipbevel"),M100)E=x.mult(-1);else{const e=M*y.add(x).mag()/y.sub(x).mag();E._perp()._mult(e*(C?-1:1))}this.addCurrentVertex(m,E,0,0,f,v),this.addCurrentVertex(m,E.mult(-1),0,0,f,v)}else if("bevel"===w||"fakeround"===w){const e=-Math.sqrt(M*M-1),t=C?e:0,i=C?0:e;if(_&&this.addCurrentVertex(m,y,t,i,f,v),"fakeround"===w){const e=Math.round(180*A/Math.PI/20);for(let t=1;t2*p){const t=m.add(g.sub(m)._mult(p/e)._round());this.updateDistance(m,t),this.addCurrentVertex(t,x,0,0,f,v),m=t}}}}addVerticesTo(e,t,i,r,n,o,s,a,l,c){const h=(t.w-e.w)/this.tessellationStep|0;if(h>1){this.lineSoFar=e.w;const u=(t.x-e.x)/h,d=(t.y-e.y)/h,p=(t.z-e.z)/h,f=(t.w-e.w)/h;for(let t=1;t=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,c),a.primitiveLength++),o?this.e2=c:this.e1=c,null!=l&&this.zOffsetVertexArray.emplaceBack(l)}updateScaledDistance(){if(this.lineClips){const e=this.totalDistance/(this.lineClips.end-this.lineClips.start);this.scaledDistance=this.distance/this.totalDistance,this.lineSoFar=e*this.lineClips.start+this.distance}else this.lineSoFar=this.distance}updateDistance(e,t){this.distance+=e.dist(t),this.updateScaledDistance()}}function om(e,t,i){return e.xi||e.yi}let sm,am;function lm(e,t,i){return t*(uo/(e.tileSize*Math.pow(2,i-e.tileID.overscaledZ)))}function cm(e,t){return 1/lm(e,1,t.tileZoom)}function hm(e,t,i,r){return e.translatePosMatrix(r||t.tileID.projMatrix,t,i.paint.get("line-translate"),i.paint.get("line-translate-anchor"))}wa(nm,"LineBucket",{omit:["layers","patternFeatures","currentVertex","currentVertexIsOutside"]});const um=e=>{const t=[];dm(e)&&t.push("RENDER_LINE_DASH"),e.paint.get("line-gradient")&&t.push("RENDER_LINE_GRADIENT");const i=e.paint.get("line-trim-offset");0===i[0]&&0===i[1]||t.push("RENDER_LINE_TRIM_OFFSET"),0!==e.paint.get("line-border-width").constantOr(1)&&t.push("RENDER_LINE_BORDER");const r="none"===e.layout.get("line-join").constantOr("miter"),n=!!e.paint.get("line-pattern").constantOr(1);return r&&n&&t.push("LINE_JOIN_NONE"),t};function dm(e){const t=e.paint.get("line-dasharray").value;return t.value||"constant"!==t.kind}class pm{constructor(e){this._stringToNumber={},this._numberToString=[];for(let t=0;t */ -read:function(e,t,i,r,n){var o,s,a=8*n-r-1,l=(1<>1,h=-7,u=i?n-1:0,d=i?-1:1,p=e[t+u];for(u+=d,o=p&(1<<-h)-1,p>>=-h,h+=a;h>0;o=256*o+e[t+u],u+=d,h-=8);for(s=o&(1<<-h)-1,o>>=-h,h+=r;h>0;s=256*s+e[t+u],u+=d,h-=8);if(0===o)o=1-c;else{if(o===l)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,r),o-=c}return(p?-1:1)*s*Math.pow(2,o-r)},write:function(e,t,i,r,n,o){var s,a,l,c=8*o-n-1,h=(1<>1,d=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:o-1,f=r?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=h):(s=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-s))<1&&(s--,l*=2),(t+=s+u>=1?d/l:d*Math.pow(2,1-u))*l>=2&&(s++,l/=2),s+u>=h?(a=0,s=h):s+u>=1?(a=(t*l-1)*Math.pow(2,n),s+=u):(a=t*Math.pow(2,u-1)*Math.pow(2,n),s=0));n>=8;e[i+p]=255&a,p+=f,a/=256,n-=8);for(s=s<0;e[i+p]=255&s,p+=f,s/=256,c-=8);e[i+p-f]|=128*m}},mm=gm,_m=fm;function gm(e){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(e)?e:new Uint8Array(e||0),this.pos=0,this.type=0,this.length=this.buf.length}gm.Varint=0,gm.Fixed64=1,gm.Bytes=2,gm.Fixed32=5;var ym=4294967296,xm=2.3283064365386963e-10,vm="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function bm(e){return e.type===gm.Bytes?e.readVarint()+e.pos:e.pos+1}function wm(e,t,i){return i?4294967296*t+(e>>>0):4294967296*(t>>>0)+(e>>>0)}function Tm(e,t,i){var r=t<=16383?1:t<=2097151?2:t<=268435455?3:Math.floor(Math.log(t)/(7*Math.LN2));i.realloc(r);for(var n=i.pos-1;n>=e;n--)i.buf[n+r]=i.buf[n]}function Em(e,t){for(var i=0;i>>8,e[i+2]=t>>>16,e[i+3]=t>>>24}function km(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+(e[t+3]<<24)}gm.prototype={destroy:function(){this.buf=null},readFields:function(e,t,i){for(i=i||this.length;this.pos>3,o=this.pos;this.type=7&r,e(n,t,this),this.pos===o&&this.skip(r)}return t},readMessage:function(e,t){return this.readFields(e,t,this.readVarint()+this.pos)},readFixed32:function(){var e=Rm(this.buf,this.pos);return this.pos+=4,e},readSFixed32:function(){var e=km(this.buf,this.pos);return this.pos+=4,e},readFixed64:function(){var e=Rm(this.buf,this.pos)+Rm(this.buf,this.pos+4)*ym;return this.pos+=8,e},readSFixed64:function(){var e=Rm(this.buf,this.pos)+km(this.buf,this.pos+4)*ym;return this.pos+=8,e},readFloat:function(){var e=_m.read(this.buf,this.pos,!0,23,4);return this.pos+=4,e},readDouble:function(){var e=_m.read(this.buf,this.pos,!0,52,8);return this.pos+=8,e},readVarint:function(e){var t,i,r=this.buf;return t=127&(i=r[this.pos++]),i<128?t:(t|=(127&(i=r[this.pos++]))<<7,i<128?t:(t|=(127&(i=r[this.pos++]))<<14,i<128?t:(t|=(127&(i=r[this.pos++]))<<21,i<128?t:(function(e,t,i){var r,n,o=i.buf;if(r=(112&(n=o[i.pos++]))>>4,n<128)return wm(e,r,t);if(r|=(127&(n=o[i.pos++]))<<3,n<128)return wm(e,r,t);if(r|=(127&(n=o[i.pos++]))<<10,n<128)return wm(e,r,t);if(r|=(127&(n=o[i.pos++]))<<17,n<128)return wm(e,r,t);if(r|=(127&(n=o[i.pos++]))<<24,n<128)return wm(e,r,t);if(r|=(1&(n=o[i.pos++]))<<31,n<128)return wm(e,r,t);throw new Error("Expected varint not more than 10 bytes")})(t|=(15&(i=r[this.pos]))<<28,e,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var e=this.readVarint();return e%2==1?(e+1)/-2:e/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var e=this.readVarint()+this.pos,t=this.pos;return this.pos=e,e-t>=12&&vm?(function(e,t,i){return vm.decode(e.subarray(t,i))})(this.buf,t,e):(function(e,t,i){for(var r="",n=t;n239?4:l>223?3:l>191?2:1;if(n+h>i)break;1===h?l<128&&(c=l):2===h?128==(192&(o=e[n+1]))&&(c=(31&l)<<6|63&o)<=127&&(c=null):3===h?(s=e[n+2],128==(192&(o=e[n+1]))&&128==(192&s)&&((c=(15&l)<<12|(63&o)<<6|63&s)<=2047||c>=55296&&c<=57343)&&(c=null)):4===h&&(s=e[n+2],a=e[n+3],128==(192&(o=e[n+1]))&&128==(192&s)&&128==(192&a)&&((c=(15&l)<<18|(63&o)<<12|(63&s)<<6|63&a)<=65535||c>=1114112)&&(c=null)),null===c?(c=65533,h=1):c>65535&&(c-=65536,r+=String.fromCharCode(c>>>10&1023|55296),c=56320|1023&c),r+=String.fromCharCode(c),n+=h}return r})(this.buf,t,e)},readBytes:function(){var e=this.readVarint()+this.pos,t=this.buf.subarray(this.pos,e);return this.pos=e,t},readPackedVarint:function(e,t){if(this.type!==gm.Bytes)return e.push(this.readVarint(t));var i=bm(this);for(e=e||[];this.pos127;);else if(t===gm.Bytes)this.pos=this.readVarint()+this.pos;else if(t===gm.Fixed32)this.pos+=4;else{if(t!==gm.Fixed64)throw new Error("Unimplemented type: "+t);this.pos+=8}},writeTag:function(e,t){this.writeVarint(e<<3|t)},realloc:function(e){for(var t=this.length||16;t268435455||e<0?(function(e,t){var i,r;if(e>=0?(i=e%4294967296|0,r=e/4294967296|0):(r=~(-e/4294967296),4294967295^(i=~(-e%4294967296))?i=i+1|0:(i=0,r=r+1|0)),e>=0x10000000000000000||e<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");t.realloc(10),(function(e,t,i){i.buf[i.pos++]=127&e|128,e>>>=7,i.buf[i.pos++]=127&e|128,e>>>=7,i.buf[i.pos++]=127&e|128,e>>>=7,i.buf[i.pos++]=127&e|128,i.buf[i.pos]=127&(e>>>=7)})(i,0,t),(function(e,t){var i=(7&e)<<4;t.buf[t.pos++]|=i|((e>>>=3)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e)))))})(r,t)})(e,this):(this.realloc(4),this.buf[this.pos++]=127&e|(e>127?128:0),e<=127||(this.buf[this.pos++]=127&(e>>>=7)|(e>127?128:0),e<=127||(this.buf[this.pos++]=127&(e>>>=7)|(e>127?128:0),e<=127||(this.buf[this.pos++]=e>>>7&127))))},writeSVarint:function(e){this.writeVarint(e<0?2*-e-1:2*e)},writeBoolean:function(e){this.writeVarint(Boolean(e))},writeString:function(e){e=String(e),this.realloc(4*e.length),this.pos++;var t=this.pos;this.pos=(function(e,t,i){for(var r,n,o=0;o55295&&r<57344){if(!n){r>56319||o+1===t.length?(e[i++]=239,e[i++]=191,e[i++]=189):n=r;continue}if(r<56320){e[i++]=239,e[i++]=191,e[i++]=189,n=r;continue}r=n-55296<<10|r-56320|65536,n=null}else n&&(e[i++]=239,e[i++]=191,e[i++]=189,n=null);r<128?e[i++]=r:(r<2048?e[i++]=r>>6|192:(r<65536?e[i++]=r>>12|224:(e[i++]=r>>18|240,e[i++]=r>>12&63|128),e[i++]=r>>6&63|128),e[i++]=63&r|128)}return i})(this.buf,e,this.pos);var i=this.pos-t;i>=128&&Tm(t,i,this),this.pos=t-1,this.writeVarint(i),this.pos+=i},writeFloat:function(e){this.realloc(4),_m.write(this.buf,e,this.pos,!0,23,4),this.pos+=4},writeDouble:function(e){this.realloc(8),_m.write(this.buf,e,this.pos,!0,52,8),this.pos+=8},writeBytes:function(e){var t=e.length;this.writeVarint(t),this.realloc(t);for(var i=0;i=128&&Tm(i,r,this),this.pos=i-1,this.writeVarint(r),this.pos+=r},writeMessage:function(e,t,i){this.writeTag(e,gm.Bytes),this.writeRawMessage(t,i)},writePackedVarint:function(e,t){t.length&&this.writeMessage(e,Em,t)},writePackedSVarint:function(e,t){t.length&&this.writeMessage(e,Sm,t)},writePackedBoolean:function(e,t){t.length&&this.writeMessage(e,Im,t)},writePackedFloat:function(e,t){t.length&&this.writeMessage(e,Mm,t)},writePackedDouble:function(e,t){t.length&&this.writeMessage(e,Am,t)},writePackedFixed32:function(e,t){t.length&&this.writeMessage(e,Cm,t)},writePackedSFixed32:function(e,t){t.length&&this.writeMessage(e,Pm,t)},writePackedFixed64:function(e,t){t.length&&this.writeMessage(e,zm,t)},writePackedSFixed64:function(e,t){t.length&&this.writeMessage(e,Dm,t)},writeBytesField:function(e,t){this.writeTag(e,gm.Bytes),this.writeBytes(t)},writeFixed32Field:function(e,t){this.writeTag(e,gm.Fixed32),this.writeFixed32(t)},writeSFixed32Field:function(e,t){this.writeTag(e,gm.Fixed32),this.writeSFixed32(t)},writeFixed64Field:function(e,t){this.writeTag(e,gm.Fixed64),this.writeFixed64(t)},writeSFixed64Field:function(e,t){this.writeTag(e,gm.Fixed64),this.writeSFixed64(t)},writeVarintField:function(e,t){this.writeTag(e,gm.Varint),this.writeVarint(t)},writeSVarintField:function(e,t){this.writeTag(e,gm.Varint),this.writeSVarint(t)},writeStringField:function(e,t){this.writeTag(e,gm.Bytes),this.writeString(t)},writeFloatField:function(e,t){this.writeTag(e,gm.Fixed32),this.writeFloat(t)},writeDoubleField:function(e,t){this.writeTag(e,gm.Fixed64),this.writeDouble(t)},writeBooleanField:function(e,t){this.writeVarintField(e,Boolean(t))}};var Om=d(mm);const Bm=["id","tile","layer","source","sourceLayer","state"];class Fm{constructor(e,t,i,r,n){this.type="Feature",this._vectorTileFeature=e,this._z=t,this._x=i,this._y=r,this.properties=e.properties,this.id=n}get geometry(){return void 0===this._geometry&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._x,this._y,this._z).geometry),this._geometry}set geometry(e){this._geometry=e}toJSON(){const e={type:"Feature",state:void 0,geometry:this.geometry,properties:this.properties};for(const t of Bm)void 0!==this[t]&&(e[t]=this[t]);return e}}class Nm{constructor(){this.state={},this.stateChanges={},this.deletedStates={}}updateState(e,t,i){const r=String(t);if(this.stateChanges[e]=this.stateChanges[e]||{},this.stateChanges[e][r]=this.stateChanges[e][r]||{},ii(this.stateChanges[e][r],i),null===this.deletedStates[e]){this.deletedStates[e]={};for(const t in this.state[e])t!==r&&(this.deletedStates[e][t]=null)}else if(this.deletedStates[e]&&null===this.deletedStates[e][r]){this.deletedStates[e][r]={};for(const t in this.state[e][r])i[t]||(this.deletedStates[e][r][t]=null)}else for(const t in i)this.deletedStates[e]&&this.deletedStates[e][r]&&null===this.deletedStates[e][r][t]&&delete this.deletedStates[e][r][t]}removeFeatureState(e,t,i){if(null===this.deletedStates[e])return;const r=String(t);if(this.deletedStates[e]=this.deletedStates[e]||{},i&&void 0!==t)null!==this.deletedStates[e][r]&&(this.deletedStates[e][r]=this.deletedStates[e][r]||{},this.deletedStates[e][r][i]=null);else if(void 0!==t)if(this.stateChanges[e]&&this.stateChanges[e][r])for(i in this.deletedStates[e][r]={},this.stateChanges[e][r])this.deletedStates[e][r][i]=null;else this.deletedStates[e][r]=null;else this.deletedStates[e]=null}getState(e,t){const i=String(t),r=ii({},(this.state[e]||{})[i],(this.stateChanges[e]||{})[i]);if(null===this.deletedStates[e])return{};if(this.deletedStates[e]){const i=this.deletedStates[e][t];if(null===i)return{};for(const e in i)delete r[e]}return r}initializeTileState(e,t){e.setFeatureState(this.state,t)}coalesceChanges(e,t){const i={};for(const e in this.stateChanges){this.state[e]=this.state[e]||{};const t={};for(const i in this.stateChanges[e])this.state[e][i]||(this.state[e][i]={}),ii(this.state[e][i],this.stateChanges[e][i]),t[i]=this.state[e][i];i[e]=t}for(const e in this.deletedStates){this.state[e]=this.state[e]||{};const t={};if(null===this.deletedStates[e])for(const i in this.state[e])t[i]={},this.state[e][i]={};else for(const i in this.deletedStates[e]){if(null===this.deletedStates[e][i])this.state[e][i]={};else if(this.state[e][i])for(const t of Object.keys(this.deletedStates[e][i]))delete this.state[e][i][t];t[i]=this.state[e][i]}i[e]=i[e]||{},ii(i[e],t)}if(this.stateChanges={},this.deletedStates={},0!==Object.keys(i).length)for(const r in e)e[r].setFeatureState(i,t)}}class Vm{constructor(e,t){this.tileID=e,this.x=e.canonical.x,this.y=e.canonical.y,this.z=e.canonical.z,this.grid=new va(uo,16,0),this.featureIndexArray=new xc,this.promoteId=t,this.is3DTile=!1}insert(e,t,i,r,n,o=0,s=0){const a=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(i,r,n,o);const l=this.grid;for(let e=0;e=0&&r[3]>=0&&l.insert(a,r[0],r[1],r[2],r[3])}}loadVTLayers(){if(!this.vtLayers){this.vtLayers=new Sp(new Om(this.rawTileData)).layers,this.sourceLayerCoder=new pm(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"]),this.vtFeatures={};for(const e in this.vtLayers)this.vtFeatures[e]=[]}return this.vtLayers}query(e,t,i,r){this.loadVTLayers();const n=e.params||{},o=ul(n.filter),s=e.tileResult,a=e.transform,l=s.bufferedTilespaceBounds,c=this.grid.query(l.min.x,l.min.y,l.max.x,l.max.y,((e,t,i,r)=>lu(s.bufferedTilespaceGeometry,e,t,i,r)));c.sort(jm);let h=null;a.elevation&&c.length>0&&(h=rf.create(a.elevation,this.tileID));const u={};let d;for(let l=0;l(m||(m=Wh(t,this.tileID.canonical,e.tileTransform)),i.queryIntersectsFeature(s,t,r,m,this.z,e.transform,e.pixelPosMatrix,h,n))))}return u}loadMatchingFeature(e,t,i,r,n,o,s,a,l){const{featureIndex:c,bucketIndex:h,sourceLayerIndex:u,layoutVertexArrayOffset:d}=t,p=this.bucketLayerIDs[h];if(r&&!(function(e,t){for(let i=0;i=0)return!0;return!1})(r,p))return;const f=this.sourceLayerCoder.decode(u),m=this.vtLayers[f].feature(c);if(i.needGeometry){const e=Hh(m,!0);if(!i.filter(new Ha(this.tileID.overscaledZ),e,this.tileID.canonical))return}else if(!i.filter(new Ha(this.tileID.overscaledZ),m))return;const _=this.getId(m,f);for(let t=0;t{const s=t instanceof il?t.get(o):null;return s&&s.evaluate?s.evaluate(i,r,n):s}))}function jm(e,t){return t-e}wa(Vm,"FeatureIndex",{omit:["rawTileData","sourceLayerCoder"]});var $m=24;const Gm=128;function qm(e,t){const{expression:i}=t;if("constant"===i.kind)return{kind:"constant",layoutSize:i.evaluate(new Ha(e+1))};if("source"===i.kind)return{kind:"source"};{const{zoomStops:t,interpolationType:r}=i;let n=0;for(;n{e.text=(function(e,t,i){const r=t.layout.get("text-transform").evaluate(i,{});return"uppercase"===r?e=e.toLocaleUpperCase():"lowercase"===r&&(e=e.toLocaleLowerCase()),Wa.applyArabicShaping&&(e=Wa.applyArabicShaping(e)),e})(e.text,t,i)})),e}const Ym={"!":"\ufe15","#":"\uff03",$:"\uff04","%":"\uff05","&":"\uff06","(":"\ufe35",")":"\ufe36","*":"\uff0a","+":"\uff0b",",":"\ufe10","-":"\ufe32",".":"\u30fb","/":"\uff0f",":":"\ufe13",";":"\ufe14","<":"\ufe3f","=":"\uff1d",">":"\ufe40","?":"\ufe16","@":"\uff20","[":"\ufe47","\\":"\uff3c","]":"\ufe48","^":"\uff3e",_:"\ufe33","`":"\uff40","{":"\ufe37","|":"\u2015","}":"\ufe38","~":"\uff5e","\xa2":"\uffe0","\xa3":"\uffe1","\xa5":"\uffe5","\xa6":"\uffe4","\xac":"\uffe2","\xaf":"\uffe3","\u2013":"\ufe32","\u2014":"\ufe31","\u2018":"\ufe43","\u2019":"\ufe44","\u201c":"\ufe41","\u201d":"\ufe42","\u2026":"\ufe19","\u2027":"\u30fb","\u20a9":"\uffe6","\u3001":"\ufe11","\u3002":"\ufe12","\u3008":"\ufe3f","\u3009":"\ufe40","\u300a":"\ufe3d","\u300b":"\ufe3e","\u300c":"\ufe41","\u300d":"\ufe42","\u300e":"\ufe43","\u300f":"\ufe44","\u3010":"\ufe3b","\u3011":"\ufe3c","\u3014":"\ufe39","\u3015":"\ufe3a","\u3016":"\ufe17","\u3017":"\ufe18","\uff01":"\ufe15","\uff08":"\ufe35","\uff09":"\ufe36","\uff0c":"\ufe10","\uff0d":"\ufe32","\uff0e":"\u30fb","\uff1a":"\ufe13","\uff1b":"\ufe14","\uff1c":"\ufe3f","\uff1e":"\ufe40","\uff1f":"\ufe16","\uff3b":"\ufe47","\uff3d":"\ufe48","\uff3f":"\ufe33","\uff5b":"\ufe37","\uff5c":"\u2015","\uff5d":"\ufe38","\uff5f":"\ufe35","\uff60":"\ufe36","\uff61":"\ufe12","\uff62":"\ufe41","\uff63":"\ufe42","\u2190":"\u2191","\u2192":"\u2193"};function Jm(e){return"\ufe36"===e||"\ufe48"===e||"\ufe38"===e||"\ufe44"===e||"\ufe42"===e||"\ufe3e"===e||"\ufe3c"===e||"\ufe3a"===e||"\ufe18"===e||"\ufe40"===e||"\ufe10"===e||"\ufe13"===e||"\ufe14"===e||"\uff40"===e||"\uffe3"===e||"\ufe11"===e||"\ufe12"===e}function Km(e){return"\ufe35"===e||"\ufe47"===e||"\ufe37"===e||"\ufe43"===e||"\ufe41"===e||"\ufe3d"===e||"\ufe3b"===e||"\ufe39"===e||"\ufe17"===e||"\ufe3f"===e}function Qm(e,t,i){t.glyphs=[],1===e&&i.readMessage(e_,t)}function e_(e,t,i){if(3===e){const{id:e,bitmap:r,width:n,height:o,left:s,top:a,advance:l}=i.readMessage(t_,{});t.glyphs.push({id:e,bitmap:new pd({width:n+6,height:o+6},r),metrics:{width:n,height:o,left:s,top:a,advance:l}})}else 4===e?t.ascender=i.readSVarint():5===e&&(t.descender=i.readSVarint())}function t_(e,t,i){1===e?t.id=i.readVarint():2===e?t.bitmap=i.readBytes():3===e?t.width=i.readVarint():4===e?t.height=i.readVarint():5===e?t.left=i.readSVarint():6===e?t.top=i.readSVarint():7===e&&(t.advance=i.readVarint())}const i_={horizontal:1,vertical:2,horizontalOnly:3};class r_{constructor(){this.scale=1,this.fontStack="",this.imageName=null}static forText(e,t){const i=new r_;return i.scale=e||1,i.fontStack=t,i}static forImage(e){const t=new r_;return t.imageName=e,t}}class n_{constructor(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null}static fromFeature(e,t){const i=new n_;for(let r=0;r=0&&i>=e&&s_[this.text.charCodeAt(i)];i--)t--;this.text=this.text.substring(e,t),this.sectionIndex=this.sectionIndex.slice(e,t)}substring(e,t){const i=new n_;return i.text=this.text.substring(e,t),i.sectionIndex=this.sectionIndex.slice(e,t),i.sections=this.sections,i}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce(((e,t)=>Math.max(e,this.sections[t].scale)),0)}addTextSection(e,t){this.text+=e.text,this.sections.push(r_.forText(e.scale,e.fontStack||t));const i=this.sections.length-1;for(let t=0;t=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function o_(e,t,i,r,n,o,s,a,l,c,h,u,d,p,f){const m=n_.fromFeature(e,n);u===i_.vertical&&m.verticalizePunctuation(d);let _=[];const g=(function(e,t,i,r,n,o){if(!e)return[];const s=[],a=(function(e,t,i,r,n,o){let s=0;for(let i=0;i=0;let c=0;for(let i=0;i0&&o>b&&(b=o)}else{const e=i[a.fontStack];if(!e)continue;e[m]&&(E=e[m]);const r=t[a.fontStack];if(!r)continue;const o=r.glyphs[m];if(!o)continue;if(x=o.metrics,M=8203!==m?$m:0,_){const e=void 0!==r.ascender?Math.abs(r.ascender):0,t=void 0!==r.descender?Math.abs(r.descender):0,i=(e+t)*g;w-i/2;){if(s--,s<0)return!1;a-=e[s].dist(o),o=e[s]}a+=e[s].dist(e[s+1]),s++;const l=[];let c=0;for(;ar;)c-=l.shift().angleDelta;if(c>n)return!1;s++,a+=t.dist(i)}return!0}function x_(e){let t=0;for(let i=0;ic){const h=(c-l)/o,u=qr(r.x,n.x,h),d=qr(r.y,n.y,h),p=new g_(u,d,0,n.angleTo(r),i);return!s||y_(e,p,a,s,t)?p:void 0}l+=o}}function T_(e,t,i,r,n,o,s,a,l){const c=v_(r,o,s),h=b_(r,n),u=h*s,d=0===e[0].x||e[0].x===l||0===e[0].y||e[0].y===l;return t-u=0&&g=0&&y=0&&d+c<=h){const i=new g_(g,y,0,m,t);r&&!y_(e,i,o,r,n)||p.push(i)}}u+=f}return a||p.length||s||(p=E_(e,u/2,i,r,n,o,s,!0,l)),p}function S_(e,t,i,r,n){const o=[];for(let s=0;s=r&&c.x>=r||(s.x>=r?s=new Ut(r,s.y+(r-s.x)/(c.x-s.x)*(c.y-s.y))._round():c.x>=r&&(c=new Ut(r,s.y+(r-s.x)/(c.x-s.x)*(c.y-s.y))._round()),s.y>=n&&c.y>=n||(s.y>=n?s=new Ut(s.x+(n-s.y)/(c.y-s.y)*(c.x-s.x),n)._round():c.y>=n&&(c=new Ut(s.x+(n-s.y)/(c.y-s.y)*(c.x-s.x),n)._round()),l&&s.equals(l[l.length-1])||(l=[s],o.push(l)),l.push(c)))))}}return o}function M_(e){let t=0,i=0;for(const r of e)t+=r.w*r.h,i=Math.max(i,r.w);e.sort(((e,t)=>t.h-e.h));const r=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(t/.95)),i),h:1/0}];let n=0,o=0;for(const t of e)for(let e=r.length-1;e>=0;e--){const i=r[e];if(!(t.w>i.w||t.h>i.h)){if(t.x=i.x,t.y=i.y,o=Math.max(o,t.y+t.h),n=Math.max(n,t.x+t.w),t.w===i.w&&t.h===i.h){const t=r.pop();ee.hasImage(t,i))),e.dispatchRenderCallbacks(this.haveRenderCallbacks,i);for(const r in e.getUpdatedImages(i))this.patchUpdatedImage(this.iconPositions[r],e.getImage(r,i),t),this.patchUpdatedImage(this.patternPositions[r],e.getImage(r,i),t)}patchUpdatedImage(e,t,i){if(!e||!t)return;if(e.version===t.version)return;e.version=t.version;const[r,n]=e.tl,o=!!Object.keys(this.patternPositions).length;i.update(t.data,{useMipmap:o},{x:r,y:n})}}wa(I_,"ImagePosition"),wa(C_,"ImageAtlas");const P_=1e20;function z_(e,t,i,r,n,o,s,a,l){for(let c=t;c-1);l++,o[l]=a,s[l]=c,s[l+1]=P_}for(let a=0,l=0;a{let r=this.entries[e];r||(r=this.entries[e]={glyphs:{},requests:{},ranges:{},ascender:void 0,descender:void 0});let n=r.glyphs[t];if(void 0!==n)return void i(null,{stack:e,id:t,glyph:n});if(n=this._tinySDF(r,e,t),n)return r.glyphs[t]=n,void i(null,{stack:e,id:t,glyph:n});const s=Math.floor(t/256);if(256*s>65535)return void i(new Error("glyphs > 65535 not supported"));if(r.ranges[s])return void i(null,{stack:e,id:t,glyph:n});let a=r.requests[s];a||(a=r.requests[s]=[],k_.loadGlyphRange(e,s,o,this.requestManager,((e,t)=>{if(t){r.ascender=t.ascender,r.descender=t.descender;for(const e in t.glyphs)this._doesCharSupportLocalGlyph(+e)||(r.glyphs[+e]=t.glyphs[+e]);r.ranges[s]=!0}for(const i of a)i(e,t);delete r.requests[s]}))),a.push(((r,n)=>{r?i(r):n&&i(null,{stack:e,id:t,glyph:n.glyphs[t]||null})}))}),((e,t)=>{if(e)i(e);else if(t){const e={};for(const{stack:i,id:r,glyph:n}of t)void 0===e[i]&&(e[i]={}),void 0===e[i].glyphs&&(e[i].glyphs={}),e[i].glyphs[r]=n&&{id:n.id,bitmap:n.bitmap.clone(),metrics:n.metrics},e[i].ascender=this.entries[i].ascender,e[i].descender=this.entries[i].descender;i(null,e)}}))}_doesCharSupportLocalGlyph(e){return this.localGlyphMode!==L_.none&&(this.localGlyphMode===L_.all?!!this.localFontFamily:!!this.localFontFamily&&(Aa["CJK Unified Ideographs"](e)||Aa["Hangul Syllables"](e)||Aa.Hiragana(e)||Aa.Katakana(e)||Aa["CJK Symbols and Punctuation"](e)||Aa["CJK Unified Ideographs Extension A"](e)||Aa["CJK Unified Ideographs Extension B"](e)))}_tinySDF(e,t,i){const r=this.localFontFamily;if(!r||!this._doesCharSupportLocalGlyph(i))return;let n=e.tinySDF;if(!n){let i="400";/bold/i.test(t)?i="900":/medium/i.test(t)?i="500":/light/i.test(t)&&(i="200"),n=e.tinySDF=new k_.TinySDF({fontFamily:r,fontWeight:i,fontSize:48,buffer:6,radius:16}),n.fontWeight=i}if(this.localGlyphs[n.fontWeight][i])return this.localGlyphs[n.fontWeight][i];const o=String.fromCodePoint(i),{data:s,width:a,height:l,glyphWidth:c,glyphHeight:h,glyphLeft:u,glyphTop:d,glyphAdvance:p}=n.draw(o);return this.localGlyphs[n.fontWeight][i]={id:i,bitmap:new pd({width:a,height:l},s),metrics:{width:c/R_,height:h/R_,left:u/R_,top:d/R_-27,advance:p/R_,localGlyph:!0}}}}k_.loadGlyphRange=function(e,t,i,r,n){const o=256*t,s=o+255,a=r.transformRequest(r.normalizeGlyphsURL(i).replace("{fontstack}",e).replace("{range}",`${o}-${s}`),Qi.Glyphs);rr(a,((e,t)=>{if(e)n(e);else if(t){const e={},i=(function(e){return new Om(e).readFields(Qm,{})})(t);for(const t of i.glyphs)e[t.id]=t;n(null,{glyphs:e,ascender:i.ascender,descender:i.descender})}}))},k_.TinySDF=class{constructor({fontSize:e=24,buffer:t=3,radius:i=8,cutoff:r=.25,fontFamily:n="sans-serif",fontWeight:o="normal",fontStyle:s="normal"}={}){this.buffer=t,this.cutoff=r,this.radius=i;const a=this.size=e+4*t,l=this._createCanvas(a),c=this.ctx=l.getContext("2d",{willReadFrequently:!0});c.font=`${s} ${o} ${e}px ${n}`,c.textBaseline="alphabetic",c.textAlign="left",c.fillStyle="black",this.gridOuter=new Float64Array(a*a),this.gridInner=new Float64Array(a*a),this.f=new Float64Array(a),this.z=new Float64Array(a+1),this.v=new Uint16Array(a)}_createCanvas(e){const t=document.createElement("canvas");return t.width=t.height=e,t}draw(e){const{width:t,actualBoundingBoxAscent:i,actualBoundingBoxDescent:r,actualBoundingBoxLeft:n,actualBoundingBoxRight:o}=this.ctx.measureText(e),s=Math.ceil(i),a=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(o-n))),l=Math.min(this.size-this.buffer,s+Math.ceil(r)),c=a+2*this.buffer,h=l+2*this.buffer,u=Math.max(c*h,0),d=new Uint8ClampedArray(u),p={data:d,width:c,height:h,glyphWidth:a,glyphHeight:l,glyphTop:s,glyphLeft:0,glyphAdvance:t};if(0===a||0===l)return p;const{ctx:f,buffer:m,gridInner:_,gridOuter:g}=this;f.clearRect(m,m,a,l),f.fillText(e,m,m+s);const y=f.getImageData(m,m,a,l);g.fill(P_,0,u),_.fill(0,0,u);for(let e=0;e0?e*e:0,_[r]=e<0?e*e:0}}z_(g,0,0,c,h,c,this.f,this.v,this.z),z_(_,m,m,a,l,c,this.f,this.v,this.z);for(let e=0;ee+t[1]-t[0],f=u.reduce(p,0),m=d.reduce(p,0),_=a-f,g=l-m;let y=0,x=f,v=0,b=m,w=0,T=_,E=0,S=g;if(o.content&&r){const e=o.content;y=F_(u,0,e[0]),v=F_(d,0,e[1]),x=F_(u,e[0],e[2]),b=F_(d,e[1],e[3]),w=e[0]-y,E=e[1]-v,T=e[2]-e[0]-x,S=e[3]-e[1]-b}const M=(r,n,a,l)=>{const u=V_(r.stretch-y,x,c,e.left),d=U_(r.fixed-w,T,r.stretch,f),p=V_(n.stretch-v,b,h,e.top),_=U_(n.fixed-E,S,n.stretch,m),g=V_(a.stretch-y,x,c,e.left),M=U_(a.fixed-w,T,a.stretch,f),A=V_(l.stretch-v,b,h,e.top),I=U_(l.fixed-E,S,l.stretch,m),C=new Ut(u,p),P=new Ut(g,p),z=new Ut(g,A),D=new Ut(u,A),R=new Ut(d/s,_/s),L=new Ut(M/s,I/s),k=t*Math.PI/180;if(k){const e=Math.sin(k),t=Math.cos(k),i=[t,-e,e,t];C._matMult(i),P._matMult(i),D._matMult(i),z._matMult(i)}const O=r.stretch+r.fixed,B=a.stretch+a.fixed,F=n.stretch+n.fixed,N=l.stretch+l.fixed,V=e.imageSecondary;return{tl:C,tr:P,bl:D,br:z,texPrimary:{x:o.paddedRect.x+O_+O,y:o.paddedRect.y+O_+F,w:B-O,h:N-F},texSecondary:V?{x:V.paddedRect.x+O_+O,y:V.paddedRect.y+O_+F,w:B-O,h:N-F}:void 0,writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:R,pixelOffsetBR:L,minFontScaleX:T/s/c,minFontScaleY:S/s/h,isSDF:i}};if(r&&(o.stretchX||o.stretchY)){const e=N_(u,_,f),t=N_(d,g,m);for(let i=0;io)&&(o=t.x),(!e||t.y>s)&&(s=t.y)}const l=Math.min(o-r,s-n);let c=l/2;const h=new ho([],G_);if(0===l)return new Ut(r,n);for(let t=r;tu.d||!u.d)&&(u=r,i&&console.log("found best %d after %d probes",Math.round(1e4*r.d)/1e4,d)),r.max-u.d<=t||(c=r.h/2,h.push(new q_(r.p.x-c,r.p.y-c,c,e)),h.push(new q_(r.p.x+c,r.p.y-c,c,e)),h.push(new q_(r.p.x-c,r.p.y+c,c,e)),h.push(new q_(r.p.x+c,r.p.y+c,c,e)),d+=4)}return i&&(console.log(`num probes: ${d}`),console.log(`best distance: ${u.d}`)),u.p}function G_(e,t){return t.max-e.max}class q_{constructor(e,t,i,r){this.p=new Ut(e,t),this.h=i,this.d=(function(e,t){let i=!1,r=1/0;for(let n=0;ne.y!=a.y>e.y&&e.x<(a.x-n.x)*(e.y-n.y)/(a.y-n.y)+n.x&&(i=!i),r=Math.min(r,ou(e,n,a))}}return(i?1:-1)*Math.sqrt(r)})(this.p,r),this.max=this.d+this.h*Math.SQRT2}}const Z_=Number.POSITIVE_INFINITY,W_=Math.sqrt(2);function H_(e,[t,i]){let r=0,n=0;if(i===Z_){t<0&&(t=0);const i=t/W_;switch(e){case"top-right":case"top-left":n=i-7;break;case"bottom-right":case"bottom-left":n=7-i;break;case"bottom":n=7-t;break;case"top":n=t-7}switch(e){case"top-right":case"bottom-right":r=-i;break;case"top-left":case"bottom-left":r=i;break;case"left":r=t;break;case"right":r=-t}}else{switch(t=Math.abs(t),i=Math.abs(i),e){case"top-right":case"top-left":case"top":n=i-7;break;case"bottom-right":case"bottom-left":case"bottom":n=7-i}switch(e){case"top-right":case"bottom-right":case"right":r=-t;break;case"top-left":case"bottom-left":case"left":r=t}}return[r,n]}function X_(e){switch(e){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function Y_(e,t,i,r,n,o,s,a,l,c,h,u,d,p,f){let m=o.textMaxSize.evaluate(t,{},u);void 0===m&&(m=s);const _=e.layers[0].layout,g=_.get("icon-offset").evaluate(t,{},u),y=eg(i.horizontal)||i.vertical,x="globe"===d.name,v=$m,b=s/v,w=e.tilePixelRatio*m/v,T=(z=e.overscaling,e.zoom>18&&z>2&&(z>>=1),Math.max(uo/(512*z),1)*_.get("symbol-spacing")),E=_.get("text-padding")*e.tilePixelRatio,S=_.get("icon-padding")*e.tilePixelRatio,M=qt(_.get("text-max-angle")),A="map"===_.get("text-rotation-alignment")&&"point"!==_.get("symbol-placement"),I="map"===_.get("icon-rotation-alignment")&&"point"!==_.get("symbol-placement"),C=_.get("symbol-placement"),P=T/2;var z;const D=_.get("icon-text-fit").evaluate(t,{},u),R=_.get("icon-text-fit-padding").evaluate(t,{},u),L="none"!==D;let k;!1===e.hasAnyIconTextFit&&L&&(e.hasAnyIconTextFit=!0),r&&L&&(e.allowVerticalPlacement&&i.vertical&&(k=__(r,i.vertical,D,R,g,b)),y&&(r=__(r,y,D,R,g,b)));const O=(s,a,m)=>{if(a.x<0||a.x>=uo||a.y<0||a.y>=uo)return;let _=null;if(x){const{x:e,y:t,z:i}=d.projectTilePoint(a.x,a.y,m);_={anchor:new g_(e,t,i,0,void 0),up:d.upVector(m,a.x,a.y)}}!(function(e,t,i,r,n,o,s,a,l,c,h,u,d,p,f,m,_,g,y,x,v,b,w,T,E,S,M){const A=e.addToLineVertexArray(t,r);let I,C,P,z,D,R,L,k=0,O=0,B=0,F=0,N=-1,V=-1;const U={};let j=Dr("");const $=i?i.anchor:t,G="none"!==l.layout.get("icon-text-fit").evaluate(v,{},E);let q=0,Z=0;if(void 0===l._unevaluatedLayout.getValue("text-radial-offset")?[q,Z]=l.layout.get("text-offset").evaluate(v,{},E).map((e=>e*$m)):(q=l.layout.get("text-radial-offset").evaluate(v,{},E)*$m,Z=Z_),e.allowVerticalPlacement&&n.vertical){const e=n.vertical;if(f)R=ig(e),a&&(L=ig(a));else{const i=l.layout.get("text-rotate").evaluate(v,{},E)+90;P=tg(c,$,t,h,u,d,e,p,i,m),a&&(z=tg(c,$,t,h,u,d,a,g,i))}}if(o){const r=l.layout.get("icon-rotate").evaluate(v,{},E),n=B_(o,r,w,G),s=a?B_(a,r,w,G):void 0;C=tg(c,$,t,h,u,d,o,g,r),k=4*n.length;const p=e.iconSizeData;let f=null;"source"===p.kind?(f=[Gm*l.layout.get("icon-size").evaluate(v,{},E)],f[0]>K_&&fi(`${e.layerIds[0]}: Value for "icon-size" is >= ${J_}. Reduce your "icon-size".`)):"composite"===p.kind&&(f=[Gm*b.compositeIconSizes[0].evaluate(v,{},E),Gm*b.compositeIconSizes[1].evaluate(v,{},E)],(f[0]>K_||f[1]>K_)&&fi(`${e.layerIds[0]}: Value for "icon-size" is >= ${J_}. Reduce your "icon-size".`)),e.addSymbols(e.icon,n,f,x,y,v,!1,i,t,A.lineStartIndex,A.lineLength,-1,T,E,S,M),N=e.icon.placedSymbolArray.length-1,s&&(O=4*s.length,e.addSymbols(e.icon,s,f,x,y,v,i_.vertical,i,t,A.lineStartIndex,A.lineLength,-1,T,E,S,M),V=e.icon.placedSymbolArray.length-1)}for(const r in n.horizontal){const o=n.horizontal[r];I||(j=Dr(o.text),f?D=ig(o):I=tg(c,$,t,h,u,d,o,p,l.layout.get("text-rotate").evaluate(v,{},E),m));const a=1===o.positionedLines.length;if(B+=Q_(e,i,t,o,s,l,f,v,m,A,n.vertical?i_.horizontal:i_.horizontalOnly,a?Object.keys(n.horizontal):[r],U,N,b,T,E,S),a)break}n.vertical&&(F+=Q_(e,i,t,n.vertical,s,l,f,v,m,A,i_.vertical,["vertical"],U,V,b,T,E,S));let W=-1;const H=(e,t)=>e?Math.max(e,t):t;W=H(D,W),W=H(R,W),W=H(L,W);const X=W>-1?1:0;e.glyphOffsetArray.length>=65535&&fi("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),void 0!==v.sortKey&&e.addToSortKeyRanges(e.symbolInstances.length,v.sortKey),e.symbolInstances.emplaceBack(t.x,t.y,$.x,$.y,$.z,U.right>=0?U.right:-1,U.center>=0?U.center:-1,U.left>=0?U.left:-1,U.vertical>=0?U.vertical:-1,N,V,j,void 0!==I?I:e.collisionBoxArray.length,void 0!==I?I+1:e.collisionBoxArray.length,void 0!==P?P:e.collisionBoxArray.length,void 0!==P?P+1:e.collisionBoxArray.length,void 0!==C?C:e.collisionBoxArray.length,void 0!==C?C+1:e.collisionBoxArray.length,z||e.collisionBoxArray.length,z?z+1:e.collisionBoxArray.length,h,B,F,k,O,X,0,q,Z,W,0,G?1:0)})(e,a,_,s,i,r,n,k,e.layers[0],e.collisionBoxArray,t.index,t.sourceLayerIndex,e.index,E,A,l,0,S,I,g,t,o,c,h,u,p,f)};if("line"===C)for(const n of S_(t.geometry,0,0,uo,uo)){const t=T_(n,T,M,i.vertical||y,r,v,w,e.overscaling,uo);for(const i of t)y&&rg(e,y.text,P,i)||O(n,i,u)}else if("line-center"===C){for(const e of t.geometry)if(e.length>1){const t=w_(e,M,i.vertical||y,r,v,w);t&&O(e,t,u)}}else if("Polygon"===t.type)for(const e of Hd(t.geometry,0)){const t=$_(e,16);O(e[0],new g_(t.x,t.y,0,0,void 0),u)}else if("LineString"===t.type)for(const e of t.geometry)O(e,new g_(e[0].x,e[0].y,0,0,void 0),u);else if("Point"===t.type)for(const e of t.geometry)for(const t of e)O([t],new g_(t.x,t.y,0,0,void 0),u)}const J_=255,K_=32640;function Q_(e,t,i,r,n,o,s,a,l,c,h,u,d,p,f,m,_,g){const y=(function(e,t,i,r,n,o,s,a){const l=[];if(0===t.positionedLines.length)return l;const c=r.layout.get("text-rotate").evaluate(o,{})*Math.PI/180,h=(function(e){const t=e[0],i=e[1],r=t*i;return r>0?[t,-i]:r<0?[-t,i]:0===t?[i,t]:[i,-t]})(i);let u=Math.abs(t.top-t.bottom);for(const e of t.positionedLines)u-=e.lineOffset;const d=t.positionedLines.length,p=u/d;let f=t.top-i[1];for(let e=0;eK_&&fi(`${e.layerIds[0]}: Value for "text-size" is >= ${J_}. Reduce your "text-size".`)):"composite"===x.kind&&(v=[Gm*f.compositeTextSizes[0].evaluate(a,{},_),Gm*f.compositeTextSizes[1].evaluate(a,{},_)],(v[0]>K_||v[1]>K_)&&fi(`${e.layerIds[0]}: Value for "text-size" is >= ${J_}. Reduce your "text-size".`)),e.addSymbols(e.text,y,v,l,s,a,h,t,i,c.lineStartIndex,c.lineLength,p,m,_,g,!1);for(const t of u)d[t]=e.text.placedSymbolArray.length-1;return 4*y.length}function eg(e){for(const t in e)return e[t];return null}function tg(e,t,i,r,n,o,s,a,l,c){let h=s.top,u=s.bottom,d=s.left,p=s.right;const f=s.collisionPadding;if(f&&(d-=f[0],h-=f[1],p+=f[2],u+=f[3]),l){const e=new Ut(d,h),t=new Ut(p,h),i=new Ut(d,u),r=new Ut(p,u),n=qt(l);let o=new Ut(0,0);c&&(o=new Ut(c[0],c[1])),e._rotateAround(n,o),t._rotateAround(n,o),i._rotateAround(n,o),r._rotateAround(n,o),d=Math.min(e.x,t.x,i.x,r.x),p=Math.max(e.x,t.x,i.x,r.x),h=Math.min(e.y,t.y,i.y,r.y),u=Math.max(e.y,t.y,i.y,r.y)}return e.emplaceBack(t.x,t.y,t.z,i.x,i.y,d,h,p,u,a,r,n,o),e.length-1}function ig(e){e.collisionPadding&&(e.top-=e.collisionPadding[1],e.bottom+=e.collisionPadding[3]);const t=e.bottom-e.top;return t>0?Math.max(10,t):null}function rg(e,t,i,r){const n=e.compareText;if(t in n){const e=n[t];for(let t=e.length-1;t>=0;t--)if(r.dist(e[t])x&&(v(e,c,r,n,a,l),v(c,i,a,l,o,s))}v(u,d,r,o,n,o),v(d,p,n,o,n,s),v(p,f,n,s,r,s),v(f,u,r,s,r,o),m-=x,_-=x,g+=x,y+=x;const b=1/Math.max(g-m,y-_);return{scale:b,x:m*b,y:_*b,x2:g*b,y2:y*b,projection:t}}function sg(e,{x:t,y:i},r=0){return new Ut(((t-r)*e.scale-e.x)*uo,(i*e.scale-e.y)*uo)}const ag=e.ae.identity(new Float32Array(16));class lg{constructor(e){this.spec=e,this.name=e.name,this.wrap=!1,this.requiresDraping=!1,this.supportsWorldCopies=!1,this.supportsTerrain=!1,this.supportsFog=!1,this.supportsFreeCamera=!1,this.zAxisUnit="meters",this.isReprojectedInTileSpace=!0,this.unsupportedLayers=["custom"],this.center=[0,0],this.range=[3.5,7]}project(e,t){return{x:0,y:0,z:0}}unproject(e,t){return new _h(0,0)}projectTilePoint(e,t,i){return{x:e,y:t,z:0}}locationPoint(e,t,i=!0){return e._coordinatePoint(e.locationCoordinate(t),i)}pixelsPerMeter(e,t){return Ph(1,e)*t}pixelSpaceConversion(e,t,i){return 1}farthestPixelDistance(e){return ng(e,e.pixelsPerMeter)}pointCoordinate(e,t,i,r){const n=e.horizonLineFromTop(!1),o=new Ut(t,Math.max(n,i));return e.rayIntersectionCoordinate(e.pointRayIntersection(o,r))}pointCoordinate3D(e,t,i){const r=new Ut(t,i);if(e.elevation)return e.elevation.pointCoordinate(r);{const t=this.pointCoordinate(e,r.x,r.y,0);return[t.x,t.y,t.z]}}isPointAboveHorizon(e,t){if(e.elevation&&e.elevation.visibleDemTiles.length)return!this.pointCoordinate3D(e,t.x,t.y);const i=e.horizonLineFromTop();return t.y0?t<-gg+i&&(t=-gg+i):t>gg-i&&(t=gg-i);const o=n/Math.pow(yg(t),r);let s=o*Math.sin(r*e),a=n-o*Math.cos(r*e);return s=.5*(s/Math.PI+.5),a=.5*(a/Math.PI+.5),{x:s,y:this.southernCenter?a:1-a,z:0}}unproject(e,t){e=(2*e-.5)*Math.PI,this.southernCenter&&(t=1-t),t=(2*(1-t)-.5)*Math.PI;const{n:i,f:r}=this,n=r-t,o=Math.sign(n),s=Math.sign(i)*Math.sqrt(e*e+n*n);let a=Math.atan2(e,Math.abs(n))*o;n*i<0&&(a-=Math.PI*Math.sign(e)*o);const l=Jt(Zt(a/i)+this.center[0],-180,180),c=Jt(Zt(2*Math.atan(Math.pow(r/s,1/i))-gg),-85.051129,Lh);return new _h(l,this.southernCenter?-c:c)}}class vg extends lg{constructor(e){super(e),this.wrap=!0,this.supportsWorldCopies=!0,this.supportsTerrain=!0,this.supportsFog=!0,this.supportsFreeCamera=!0,this.isReprojectedInTileSpace=!1,this.unsupportedLayers=[],this.range=null}project(e,t){return{x:Ih(e),y:Ch(t),z:0}}unproject(e,t){const i=zh(e),r=Dh(t);return new _h(i,r)}}const bg=qt(Lh);class wg extends lg{project(e,t){const i=(t=qt(t))*t,r=i*i;return{x:.5*((e=qt(e))*(.8707-.131979*i+r*(r*(.003971*i-.001529*r)-.013791))/Math.PI+.5),y:1-.5*(t*(1.007226+i*(.015085+r*(.028874*i-.044475-.005916*r)))/Math.PI+1),z:0}}unproject(e,t){e=(2*e-.5)*Math.PI;let i=t=(2*(1-t)-1)*Math.PI,r=25,n=0,o=i*i;do{o=i*i;const e=o*o;n=(i*(1.007226+o*(.015085+e*(.028874*o-.044475-.005916*e)))-t)/(1.007226+o*(.045255+e*(.259866*o-.311325-.06507600000000001*e))),i=Jt(i-n,-bg,bg)}while(Math.abs(n)>1e-6&&--r>0);o=i*i;const s=Jt(Zt(e/(.8707+o*(o*(o*o*o*(.003971-.001529*o)-.013791)-.131979))),-180,180),a=Zt(i);return new _h(s,a)}}const Tg=qt(Lh);class Eg extends lg{project(e,t){t=qt(t),e=qt(e);const i=Math.cos(t),r=2/Math.PI,n=Math.acos(i*Math.cos(e/2)),o=Math.sin(n)/n,s=.5*(e*r+2*i*Math.sin(e/2)/o)||0,a=.5*(t+Math.sin(t)/o)||0;return{x:.5*(s/Math.PI+.5),y:1-.5*(a/Math.PI+1),z:0}}unproject(e,t){let i=e=(2*e-.5)*Math.PI,r=t=(2*(1-t)-1)*Math.PI,n=25;const o=1e-6;let s=0,a=0;do{const n=Math.cos(r),o=Math.sin(r),l=2*o*n,c=o*o,h=n*n,u=Math.cos(i/2),d=Math.sin(i/2),p=2*u*d,f=d*d,m=1-h*u*u,_=m?1/m:0,g=m?Math.acos(n*u)*Math.sqrt(1/m):0,y=.5*(2*g*n*d+2*i/Math.PI)-e,x=.5*(g*o+r)-t,v=.5*_*(h*f+g*n*u*c)+1/Math.PI,b=_*(p*l/4-g*o*d),w=.125*_*(l*d-g*o*h*p),T=.5*_*(c*u+g*f*n)+.5,E=b*w-T*v;s=(x*b-y*T)/E,a=(y*w-x*v)/E,i=Jt(i-s,-Math.PI,Math.PI),r=Jt(r-a,-Tg,Tg)}while((Math.abs(s)>o||Math.abs(a)>o)&&--n>0);return new _h(Zt(i),Zt(r))}}class Sg extends lg{constructor(e){super(e),this.center=e.center||[0,0],this.parallels=e.parallels||[0,0],this.cosPhi=Math.max(.01,Math.cos(qt(this.parallels[0]))),this.scale=1/(2*Math.max(Math.PI*this.cosPhi,1/this.cosPhi)),this.wrap=!0,this.supportsWorldCopies=!0}project(e,t){const{scale:i,cosPhi:r}=this;return{x:qt(e)*r*i+.5,y:-Math.sin(qt(t))/r*i+.5,z:0}}unproject(e,t){const{scale:i,cosPhi:r}=this,n=-(t-.5)/i,o=Jt(Zt((e-.5)/i)/r,-180,180),s=Math.asin(Jt(n*r,-1,1)),a=Jt(Zt(s),-85.051129,Lh);return new _h(o,a)}}class Mg extends vg{constructor(e){super(e),this.requiresDraping=!0,this.supportsWorldCopies=!1,this.supportsFog=!0,this.zAxisUnit="pixels",this.unsupportedLayers=["debug"],this.range=[3,5]}projectTilePoint(t,i,r){const n=ju(t,i,r),o=qu(ku(r));return e.$.transformMat4(n,n,o),{x:n[0],y:n[1],z:n[2]}}locationPoint(t,i){const r=ph(i.lat,i.lng),n=e.$.normalize([],r),o=t.elevation?t.elevation.getAtPointOrZero(t.locationCoordinate(i),t._centerAltitude):t._centerAltitude,s=Ph(1,0)*uo*o;e.$.scaleAndAdd(r,r,n,s);const a=e.ae.identity(new Float64Array(16));return e.ae.multiply(a,t.pixelMatrix,t.globeMatrix),e.$.transformMat4(r,r,a),new Ut(r[0],r[1])}pixelsPerMeter(e,t){return Ph(1,0)*t}pixelSpaceConversion(e,t,i){const r=Ph(1,e)*t,n=qr(Ph(1,45)*t,r,i);return this.pixelsPerMeter(e,t)/n}createTileMatrix(t,i,r){const n=Zu(ku(r.canonical));return e.ae.multiply(new Float64Array(16),t.globeMatrix,n)}createInversionMatrix(t,i){const{center:r}=t,n=qu(ku(i));return e.ae.rotateY(n,n,qt(r.lng)),e.ae.rotateX(n,n,qt(r.lat)),e.ae.scale(n,n,[t._pixelsPerMercatorPixel,t._pixelsPerMercatorPixel,1]),Float32Array.from(n)}pointCoordinate(e,t,i,r){return Du(e,t,i,!0)||new Nh(0,0)}pointCoordinate3D(e,t,i){const r=this.pointCoordinate(e,t,i,0);return[r.x,r.y,r.z]}isPointAboveHorizon(e,t){return!Du(e,t.x,t.y,!1)}farthestPixelDistance(t){const i=(function(t,i){const r=t.cameraToCenterDistance,n=t._centerAltitude*i,o=t._camera,s=t._camera.forward(),a=e.$.add([],e.$.scale([],s,-r),[0,0,n]),l=t.worldSize/(2*Math.PI),c=[0,0,-l],h=t.width/t.height,u=Math.tan(t.fovAboveCenter),d=e.$.scale([],o.up(),u),p=e.$.scale([],o.right(),u*h),f=e.$.normalize([],e.$.add([],e.$.add([],s,d),p)),m=[];let _;if(new yu(a,f).closestPointOnSphere(c,l,m)){const i=e.$.add([],m,c),r=e.$.sub([],i,a);_=Math.cos(t.fovAboveCenter)*e.$.length(r)}else{const t=e.$.sub([],a,c),i=e.$.sub([],c,a);e.$.normalize(i,i);const r=e.$.length(t)-l;_=Math.sqrt(r*(r+2*l));const n=Math.acos(_/(l+r))-Math.acos(e.$.dot(s,i));_*=Math.cos(n)}return 1.01*_})(t,this.pixelsPerMeter(t.center.lat,t.worldSize)),r=Yu(t.zoom);if(r>0){const e=ng(t,Ph(1,t.center.lat)*t.worldSize),n=t.worldSize/(2*Math.PI),o=Math.max(t.width,t.height)/t.worldSize*Math.PI;return qr(i,e+n*(1-Math.cos(o)),Math.pow(r,10))}return i}upVector(e,t,i){return ju(t,i,e,1)}upVectorScale(e){return{metersToTile:Pu($u(ku(e)))}}}function Ag(e){const t=e.parallels,i=!!t&&Math.abs(t[0]+t[1])<.01;switch(e.name){case"mercator":return new vg(e);case"equirectangular":return new _g(e);case"naturalEarth":return new wg(e);case"equalEarth":return new mg(e);case"winkelTripel":return new Eg(e);case"albers":return i?new Sg(e):new cg(e);case"lambertConformalConic":return i?new Sg(e):new xg(e);case"globe":return new Mg(e)}throw new Error(`Invalid projection name: ${e.name}`)}const Ig=Mp.types,Cg=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function Pg(e,t,i,r,n,o,s,a,l,c,h,u,d){const p=a?Math.min(K_,Math.round(a[0])):0,f=a?Math.min(K_,Math.round(a[1])):0;e.emplaceBack(t,i,Math.round(32*r),Math.round(32*n),o,s,(p<<1)+(l?1:0),f,16*c,16*h,256*u,256*d)}function zg(e,t,i){e.emplaceBack(t,i)}function Dg(e,t,i,r,n,o,s){e.emplaceBack(t,i,r,n,o,s)}function Rg(e,t,i,r,n){e.emplaceBack(t,i,r,n),e.emplaceBack(t,i,r,n),e.emplaceBack(t,i,r,n),e.emplaceBack(t,i,r,n)}function Lg(e){for(const t of e.sections)if(ka(t.text))return!0;return!1}class kg{constructor(e){this.layoutVertexArray=new $l,this.indexArray=new Jl,this.programConfigurations=e,this.segments=new Sc,this.dynamicLayoutVertexArray=new Fl,this.opacityVertexArray=new ql,this.placedSymbolArray=new pc,this.iconTransitioningVertexArray=new Zl,this.globeExtVertexArray=new Gl,this.zOffsetVertexArray=new ec}isEmpty(){return 0===this.layoutVertexArray.length&&0===this.indexArray.length&&0===this.dynamicLayoutVertexArray.length&&0===this.opacityVertexArray.length&&0===this.iconTransitioningVertexArray.length}upload(e,t,i,r,n){this.isEmpty()||(i&&(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,qf.members),this.indexBuffer=e.createIndexBuffer(this.indexArray,t),this.dynamicLayoutVertexBuffer=e.createVertexBuffer(this.dynamicLayoutVertexArray,Wf.members,!0),this.opacityVertexBuffer=e.createVertexBuffer(this.opacityVertexArray,Cg,!0),this.iconTransitioningVertexArray.length>0&&(this.iconTransitioningVertexBuffer=e.createVertexBuffer(this.iconTransitioningVertexArray,Xf.members,!0)),this.globeExtVertexArray.length>0&&(this.globeExtVertexBuffer=e.createVertexBuffer(this.globeExtVertexArray,Zf.members,!0)),!this.zOffsetVertexBuffer&&(this.zOffsetVertexArray.length>0||n)&&(this.zOffsetVertexBuffer=e.createVertexBuffer(this.zOffsetVertexArray,Hf.members,!0)),this.opacityVertexBuffer.itemSize=1),(i||r)&&this.programConfigurations.upload(e))}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy(),this.iconTransitioningVertexBuffer&&this.iconTransitioningVertexBuffer.destroy(),this.globeExtVertexBuffer&&this.globeExtVertexBuffer.destroy(),this.zOffsetVertexBuffer&&this.zOffsetVertexBuffer.destroy())}}wa(kg,"SymbolBuffers");class Og{constructor(e,t,i){this.layoutVertexArray=new e,this.layoutAttributes=t,this.indexArray=new i,this.segments=new Sc,this.collisionVertexArray=new Yl,this.collisionVertexArrayExt=new Fl}upload(e){this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=e.createVertexBuffer(this.collisionVertexArray,Yf.members,!0),this.collisionVertexBufferExt=e.createVertexBuffer(this.collisionVertexArrayExt,Jf.members,!0)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy(),this.collisionVertexBufferExt.destroy())}}wa(Og,"CollisionBuffers");class Bg{constructor(t){this.collisionBoxArray=t.collisionBoxArray,this.zoom=t.zoom,this.lut=t.lut,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((e=>e.fqid)),this.index=t.index,this.pixelRatio=t.pixelRatio,this.sourceLayerIndex=t.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.fullyClipped=!1,this.hasAnyIconTextFit=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=e.ae.identity([]),this.placementViewportMatrix=e.ae.identity([]);const i=this.layers[0]._unevaluatedLayout._values;this.textSizeData=qm(this.zoom,i["text-size"]),this.iconSizeData=qm(this.zoom,i["icon-size"]);const r=this.layers[0].layout,n=r.get("symbol-sort-key"),o=r.get("symbol-z-order");this.canOverlap=r.get("text-allow-overlap")||r.get("icon-allow-overlap")||r.get("text-ignore-placement")||r.get("icon-ignore-placement"),this.sortFeaturesByKey="viewport-y"!==o&&void 0!==n.constantOr(1),this.sortFeaturesByY=("viewport-y"===o||"auto"===o&&!this.sortFeaturesByKey)&&this.canOverlap,this.writingModes=r.get("text-writing-mode").map((e=>i_[e])),this.stateDependentLayerIds=this.layers.filter((e=>e.isStateDependent())).map((e=>e.id)),this.sourceID=t.sourceID,this.projection=t.projection,this.hasAnyZOffset=!1,this.zOffsetSortDirty=!1,this.zOffsetBuffersNeedUpload=r.get("symbol-z-elevate"),this.activeReplacements=[],this.replacementUpdateTime=0}createArrays(){this.text=new kg(new Kc(this.layers,{zoom:this.zoom,lut:this.lut},(e=>/^text/.test(e)))),this.icon=new kg(new Kc(this.layers,{zoom:this.zoom,lut:this.lut},(e=>/^icon/.test(e)))),this.glyphOffsetArray=new _c,this.lineVertexArray=new gc,this.symbolInstances=new mc}calculateGlyphDependencies(e,t,i,r,n){for(let i=0;i0)&&("constant"!==l.value.kind||l.value.value.length>0),d="constant"!==h.value.kind||!!h.value.value||Object.keys(h.parameters).length>0,p=s.get("symbol-sort-key");if(this.features=[],!u&&!d)return;const f=i.iconDependencies,m=i.glyphDependencies,_=i.availableImages,g=new Ha(this.zoom);for(const{feature:i,id:c,index:h,sourceLayerIndex:y}of t){const t=o._featureFilter.needGeometry,x=Hh(i,t);if(!o._featureFilter.filter(g,x,r))continue;if(t||(x.geometry=Wh(i,r,n)),a&&1!==i.type&&r.z<=5){const t=x.geometry,i=.98078528056,n=(t,n)=>{const o=ju(t.x,t.y,r,1),s=ju(n.x,n.y,r,1);return e.$.dot(o,s)=0;for(const i of v.sections)if(i.image)f[i.image.namePrimary]=!0;else{const r=Ia(v.toString()),n=i.fontStack||e,o=m[n]=m[n]||{};this.calculateGlyphDependencies(i.text,o,t,this.allowVerticalPlacement,r)}}}"line"===s.get("symbol-placement")&&(this.features=(function(e){const t={},i={},r=[];let n=0;function o(t){r.push(e[t]),n++}function s(e,t,n){const o=i[e];return delete i[e],i[t]=o,r[o].geometry[0].pop(),r[o].geometry[0]=r[o].geometry[0].concat(n[0]),o}function a(e,i,n){const o=t[i];return delete t[i],t[e]=o,r[o].geometry[0].shift(),r[o].geometry[0]=n[0].concat(r[o].geometry[0]),o}function l(e,t,i){const r=i?t[0][t[0].length-1]:t[0][0];return`${e}:${r.x}:${r.y}`}for(let c=0;ce.geometry))})(this.features)),this.sortFeaturesByKey&&this.features.sort(((e,t)=>e.sortKey-t.sortKey))}update(e,t,i,r,n){const o=0!==Object.keys(e).length;if(o&&!this.stateDependentLayers.length)return;const s=o?this.stateDependentLayers:this.layers;this.text.programConfigurations.updatePaintArrays(e,t,s,i,r,n),this.icon.programConfigurations.updatePaintArrays(e,t,s,i,r,n)}updateZOffset(){const e=(e,t,r)=>{i+=t,i>e.length&&e.resize(i);for(let n=-t;n<0;n++)e.emplace(n+i,r)},t=(e,t,i)=>{r+=t,r>e.length&&e.resize(r);for(let n=-t;n<0;n++)e.emplace(n+r,i)};if(!this.zOffsetBuffersNeedUpload)return;this.zOffsetBuffersNeedUpload=!1;let i=0,r=0;for(let i=0;i0;if((n>0||o>0)&&(e(this.text.zOffsetVertexArray,n,a),e(this.text.zOffsetVertexArray,o,a)),l){const{placedIconSymbolIndex:e,verticalPlacedIconSymbolIndex:i}=r;e>=0&&t(this.icon.zOffsetVertexArray,s,a),i>=0&&t(this.icon.zOffsetVertexArray,r.numVerticalIconVertices,a)}}this.text.zOffsetVertexBuffer&&this.text.zOffsetVertexBuffer.updateData(this.text.zOffsetVertexArray),this.icon.zOffsetVertexBuffer&&this.icon.zOffsetVertexBuffer.updateData(this.icon.zOffsetVertexArray)}isEmpty(){return 0===this.symbolInstances.length&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(e){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(e),this.iconCollisionBox.upload(e)),this.text.upload(e,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload,this.zOffsetBuffersNeedUpload),this.icon.upload(e,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload,this.zOffsetBuffersNeedUpload),this.uploaded=!0}destroyDebugData(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()}getProjection(){return this.projectionInstance||(this.projectionInstance=Ag(this.projection)),this.projectionInstance}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(e,t){const i=this.lineVertexArray.length;if(void 0!==e.segment)for(const{x:e,y:i}of t)this.lineVertexArray.emplaceBack(e,i);return{lineStartIndex:i,lineLength:this.lineVertexArray.length-i}}addSymbols(e,t,i,r,n,o,s,a,l,c,h,u,d,p,f,m){const _=e.indexArray,g=e.layoutVertexArray,y=e.globeExtVertexArray,x=e.segments.prepareSegment(4*t.length,g,_,this.canOverlap?o.sortKey:void 0),v=this.glyphOffsetArray.length,b=x.vertexLength,w=this.allowVerticalPlacement&&s===i_.vertical?Math.PI/2:0,T=o.text&&o.text.sections;for(let r=0;r=0?t.rightJustifiedTextSymbolIndex:t.centerJustifiedTextSymbolIndex>=0?t.centerJustifiedTextSymbolIndex:t.leftJustifiedTextSymbolIndex>=0?t.leftJustifiedTextSymbolIndex:t.verticalPlacedTextSymbolIndex>=0?t.verticalPlacedTextSymbolIndex:r),o=Zm(this.textSizeData,e,n)/$m;return this.tilePixelRatio*o}getSymbolInstanceIconSize(e,t,i){const r=this.icon.placedSymbolArray.get(i),n=Zm(this.iconSizeData,e,r);return this.tilePixelRatio*n}_commitDebugCollisionVertexUpdate(e,t,i,r){e.emplaceBack(t,-i,-i,r),e.emplaceBack(t,i,-i,r),e.emplaceBack(t,i,i,r),e.emplaceBack(t,-i,i,r)}_updateTextDebugCollisionBoxes(e,t,i,r,n,o){for(let s=r;s0}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}hasIconTextFit(){return this.hasAnyIconTextFit}addIndicesForPlacedSymbol(e,t){const i=e.placedSymbolArray.get(t),r=i.vertexStartIndex+4*i.numGlyphs;for(let t=i.vertexStartIndex;tr[e]-r[t]||n[t]-n[e])),o}getSortedIndexesByZOffset(){if(!this.zOffsetSortDirty)return this.symbolInstanceIndexesSortedZOffset;if(!this.symbolInstanceIndexesSortedZOffset){this.symbolInstanceIndexesSortedZOffset=[];for(let e=0;ethis.symbolInstances.get(t).zOffset-this.symbolInstances.get(e).zOffset))}addToSortKeyRanges(e,t){const i=this.sortKeyRanges[this.sortKeyRanges.length-1];i&&i.sortKey===t?i.symbolInstanceEnd=e+1:this.sortKeyRanges.push({sortKey:t,symbolInstanceStart:e,symbolInstanceEnd:e+1})}sortFeatures(e){if(this.sortFeaturesByY&&this.sortedAngle!==e&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(e),this.sortedAngle=e,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(const e of this.symbolInstanceIndexes){const t=this.symbolInstances.get(e);this.featureSortOrder.push(t.featureIndex);const{rightJustifiedTextSymbolIndex:i,centerJustifiedTextSymbolIndex:r,leftJustifiedTextSymbolIndex:n,verticalPlacedTextSymbolIndex:o,placedIconSymbolIndex:s,verticalPlacedIconSymbolIndex:a}=t;i>=0&&this.addIndicesForPlacedSymbol(this.text,i),r>=0&&r!==i&&this.addIndicesForPlacedSymbol(this.text,r),n>=0&&n!==r&&n!==i&&this.addIndicesForPlacedSymbol(this.text,n),o>=0&&this.addIndicesForPlacedSymbol(this.text,o),s>=0&&this.addIndicesForPlacedSymbol(this.icon,s),a>=0&&this.addIndicesForPlacedSymbol(this.icon,a)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}wa(Bg,"SymbolBucket",{omit:["layers","collisionBoxArray","features","compareText"]}),Bg.addDynamicAttributes=Rg;class Fg{constructor(e,t,i,r){this.context=e,this.format=i,this.texture=e.gl.createTexture(),this.update(t,r)}update(e,t,i){const{width:r,height:n}=e,{context:o}=this,{gl:s}=o;if(s.bindTexture(s.TEXTURE_2D,this.texture),o.pixelStoreUnpackFlipY.set(!1),o.pixelStoreUnpack.set(1),o.pixelStoreUnpackPremultiplyAlpha.set(this.format===s.RGBA&&(!t||!1!==t.premultiply)),this.useMipmap=Boolean(t&&t.useMipmap),i||this.size&&this.size[0]===r&&this.size[1]===n){const{x:t,y:o}=i||{x:0,y:0};if(e instanceof HTMLImageElement||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement||e instanceof ImageData||ImageBitmap&&e instanceof ImageBitmap)s.texSubImage2D(s.TEXTURE_2D,0,t,o,s.RGBA,s.UNSIGNED_BYTE,e);else{let i=this.format,a=s.UNSIGNED_BYTE;this.format===s.R32F&&(i=s.RED,a=s.FLOAT),s.texSubImage2D(s.TEXTURE_2D,0,t,o,r,n,i,a,e.data)}}else if(this.size=[r,n],e instanceof HTMLImageElement||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement||e instanceof ImageData||ImageBitmap&&e instanceof ImageBitmap){let t=this.format;this.format===s.R8&&(t=s.RED),s.texImage2D(s.TEXTURE_2D,0,this.format,t,s.UNSIGNED_BYTE,e)}else{let t=this.format,i=this.format,o=s.UNSIGNED_BYTE,a=!1;this.format===s.DEPTH_COMPONENT&&(t=s.DEPTH_COMPONENT16,o=s.UNSIGNED_SHORT),this.format===s.DEPTH_STENCIL&&(t=s.DEPTH24_STENCIL8,o=s.UNSIGNED_INT_24_8,a=!0),this.format===s.R8&&(i=s.RED),this.format===s.R32F&&(o=s.FLOAT,i=s.RED),!this.useMipmap&&a?s.texStorage2D(s.TEXTURE_2D,1,t,r,n):s.texImage2D(s.TEXTURE_2D,0,t,r,n,0,i,o,e.data)}this.useMipmap&&s.generateMipmap(s.TEXTURE_2D)}bind(e,t,i=!1){const{context:r}=this,{gl:n}=r;n.bindTexture(n.TEXTURE_2D,this.texture),e!==this.minFilter&&(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,e),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,this.useMipmap&&!i?e===n.NEAREST?n.NEAREST_MIPMAP_NEAREST:n.LINEAR_MIPMAP_LINEAR:e),this.minFilter=e),t!==this.wrapS&&(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,t),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,t),this.wrapS=t)}bindExtraParam(e,t,i,r){const{context:n}=this,{gl:o}=n;o.bindTexture(o.TEXTURE_2D,this.texture),t!==this.magFilter&&(o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MAG_FILTER,t),this.magFilter=t),e!==this.minFilter&&(o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MIN_FILTER,this.useMipmap?e===o.NEAREST?o.NEAREST_MIPMAP_NEAREST:o.LINEAR_MIPMAP_LINEAR:e),this.minFilter=e),i!==this.wrapS&&(o.texParameteri(o.TEXTURE_2D,o.TEXTURE_WRAP_S,i),this.wrapS=i),r!==this.wrapT&&(o.texParameteri(o.TEXTURE_2D,o.TEXTURE_WRAP_T,r),this.wrapT=r)}destroy(){const{gl:e}=this.context;e.deleteTexture(this.texture),this.texture=null}}class Ng{constructor(e,t){this.context=e,this.texture=t}bind(e,t){const{context:i}=this,{gl:r}=i;r.bindTexture(r.TEXTURE_2D,this.texture),e!==this.minFilter&&(r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,e),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,e),this.minFilter=e),t!==this.wrapS&&(r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,t),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,t),this.wrapS=t)}}const Vg=32,Ug=33,jg=new Uint16Array(8184);for(let e=0;e<2046;e++){let t=e+2,i=0,r=0,n=0,o=0,s=0,a=0;for(1&t?n=o=s=Vg:i=r=a=Vg;(t>>=1)>1;){const e=i+n>>1,l=r+o>>1;1&t?(n=i,o=r,i=s,r=a):(i=n,r=o,n=s,o=a),s=e,a=l}const l=4*e;jg[l+0]=i,jg[l+1]=r,jg[l+2]=n,jg[l+3]=o}const $g=new Uint16Array(2178),Gg=new Uint8Array(1089),qg=new Uint16Array(1089);function Zg(e){return 0===e?-.03125:32===e?.03125:0}var Wg=zl([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);class Hg{constructor(e,t,i,r){this.id=Hg.uniqueIdxCounter,Hg.uniqueIdxCounter++,this.context=e;const n=e.gl;this.buffer=n.createBuffer(),this.dynamicDraw=Boolean(i),this.context.unbindVAO(),e.bindElementBuffer.set(this.buffer),n.bufferData(n.ELEMENT_ARRAY_BUFFER,t.arrayBuffer,this.dynamicDraw?n.DYNAMIC_DRAW:n.STATIC_DRAW),this.dynamicDraw||r||t.destroy()}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(e){this.id=Hg.uniqueIdxCounter,Hg.uniqueIdxCounter++;const t=this.context.gl;this.context.unbindVAO(),this.bind(),t.bufferSubData(t.ELEMENT_ARRAY_BUFFER,0,e.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}Hg.uniqueIdxCounter=0;class Xg{constructor(e,t,i){this.func=e,this.mask=t,this.range=i}}Xg.ReadOnly=!1,Xg.ReadWrite=!0,Xg.disabled=new Xg(519,Xg.ReadOnly,[0,1]);const Yg=7680;class Jg{constructor(e,t,i,r,n,o){this.test=e,this.ref=t,this.mask=i,this.fail=r,this.depthFail=n,this.pass=o}}Jg.disabled=new Jg({func:519,mask:0},0,0,Yg,Yg,Yg);const Kg=771;class Qg{constructor(e,t,i,r){this.blendFunction=e,this.blendColor=t,this.mask=i,this.blendEquation=r}}Qg.Replace=[1,0,1,0],Qg.disabled=new Qg(Qg.Replace,$r.transparent,[!1,!1,!1,!1]),Qg.unblended=new Qg(Qg.Replace,$r.transparent,[!0,!0,!0,!0]),Qg.alphaBlended=new Qg([1,Kg,1,Kg],$r.transparent,[!0,!0,!0,!0]),Qg.alphaBlendedNonPremultiplied=new Qg([770,Kg,770,Kg],$r.transparent,[!0,!0,!0,!0]),Qg.multiply=new Qg([774,0,774,0],$r.transparent,[!0,!0,!0,!0]);const ey=1029,ty=2305;class iy{constructor(e,t,i){this.enable=e,this.mode=t,this.frontFace=i}}iy.disabled=new iy(!1,ey,ty),iy.backCCW=new iy(!0,ey,ty),iy.backCW=new iy(!0,ey,2304),iy.frontCW=new iy(!0,1028,2304),iy.frontCCW=new iy(!0,1028,ty);var ry=zl([{name:"a_index",type:"Int16",components:1}]);const ny={type:2,extent:uo,loadGeometry:()=>[[new Ut(0,0),new Ut(8193,0),new Ut(8193,8193),new Ut(0,8193),new Ut(0,0)]]};class oy{constructor(e,t,i,r,n){this.tileID=e,this.uid=ni(),this.uses=0,this.tileSize=t,this.tileZoom=i,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.isRaster=n,r&&r.style&&(this._lastUpdatedBrightness=r.style.getBrightness()),this.expiredRequestCount=0,this.state="loading",r&&r.transform&&(this.projection=r.transform.projection)}registerFadeDuration(e){const t=e+this.timeAdded;tt.getLayer(e))).filter(Boolean);if(0!==e.length){r.layers=e,r.stateDependentLayerIds&&(r.stateDependentLayers=r.stateDependentLayerIds.map((t=>e.filter((e=>e.id===t))[0])));for(const t of e)i[t.fqid]=r}}return i})(e.buckets,t.style),this.hasSymbolBuckets=!1;for(const e in this.buckets){const t=this.buckets[e];if(t instanceof Bg){if(this.hasSymbolBuckets=!0,!i)break;t.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(const e in this.buckets){const t=this.buckets[e];if(t instanceof Bg&&t.hasRTLText){this.hasRTLText=!0,Wa.isLoading()||Wa.isLoaded()||"deferred"!==qa()||Za();break}}this.queryPadding=0;for(const e in this.buckets){const i=this.buckets[e],r=t.style.getOwnLayer(e);if(!r)continue;const n=r.queryRadius(i);this.queryPadding=Math.max(this.queryPadding,n)}e.imageAtlas&&(this.imageAtlas=e.imageAtlas),e.glyphAtlasImage&&(this.glyphAtlasImage=e.glyphAtlasImage),e.lineAtlas&&(this.lineAtlas=e.lineAtlas),this._lastUpdatedBrightness=e.brightness}else this.collisionBoxArray=new uc}unloadVectorData(){if(this.hasData()){for(const e in this.buckets)this.buckets[e].destroy();this.buckets={},this.imageAtlas&&(this.imageAtlas=null),this.lineAtlas&&(this.lineAtlas=null),this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.lineAtlasTexture&&this.lineAtlasTexture.destroy(),this._tileBoundsBuffer&&(this._tileBoundsBuffer.destroy(),this._tileBoundsIndexBuffer.destroy(),this._tileBoundsSegments.destroy(),this._tileBoundsBuffer=null),this._tileDebugBuffer&&(this._tileDebugBuffer.destroy(),this._tileDebugSegments.destroy(),this._tileDebugBuffer=null),this._tileDebugIndexBuffer&&(this._tileDebugIndexBuffer.destroy(),this._tileDebugIndexBuffer=null),this._globeTileDebugBorderBuffer&&(this._globeTileDebugBorderBuffer.destroy(),this._globeTileDebugBorderBuffer=null),this._tileDebugTextBuffer&&(this._tileDebugTextBuffer.destroy(),this._tileDebugTextSegments.destroy(),this._tileDebugTextIndexBuffer.destroy(),this._tileDebugTextBuffer=null),this._globeTileDebugTextBuffer&&(this._globeTileDebugTextBuffer.destroy(),this._globeTileDebugTextBuffer=null),this.latestFeatureIndex=null,this.state="unloaded"}}getBucket(e){return this.buckets[e.fqid]}upload(e){for(const t in this.buckets){const i=this.buckets[t];i.uploadPending()&&i.upload(e)}const t=e.gl,i=this.imageAtlas;if(i&&!i.uploaded){const r=!!Object.keys(i.patternPositions).length;this.imageAtlasTexture=new Fg(e,i.image,t.RGBA,{useMipmap:r}),this.imageAtlas.uploaded=!0}this.glyphAtlasImage&&(this.glyphAtlasTexture=new Fg(e,this.glyphAtlasImage,t.R8),this.glyphAtlasImage=null),this.lineAtlas&&!this.lineAtlas.uploaded&&(this.lineAtlasTexture=new Fg(e,this.lineAtlas.image,t.R8),this.lineAtlas.uploaded=!0)}prepare(e,t,i){if(this.imageAtlas&&this.imageAtlasTexture&&this.imageAtlas.patchUpdatedImages(e,this.imageAtlasTexture,i),!t||!this.latestFeatureIndex||!this.latestFeatureIndex.rawTileData)return;const r=t.style.getBrightness();(this._lastUpdatedBrightness||r)&&(this._lastUpdatedBrightness&&r&&Math.abs(this._lastUpdatedBrightness-r)<.001||(this._lastUpdatedBrightness=r,this.updateBuckets(void 0,t)))}queryRenderedFeatures(e,t,i,r,n,o,s,a){return this.latestFeatureIndex&&(this.latestFeatureIndex.rawTileData||this.latestFeatureIndex.is3DTile)?this.latestFeatureIndex.query({tileResult:r,pixelPosMatrix:s,transform:o,params:n,tileTransform:this.tileTransform},e,t,i):{}}querySourceFeatures(e,t){const i=this.latestFeatureIndex;if(!i||!i.rawTileData)return;const r=i.loadVTLayers(),n=t?t.sourceLayer:"",o=r._geojsonTileLayer||r[n];if(!o)return;const s=ul(t&&t.filter),{z:a,x:l,y:c}=this.tileID.canonical,h={z:a,x:l,y:c};for(let t=0;te)i=!1;else if(t)if(this.expirationTime=0;e--){const t=4*e,i=jg[t+0],r=jg[t+1],n=jg[t+2],o=jg[t+3],s=i+n>>1,a=r+o>>1,l=s+a-r,c=a+i-s,h=r*Ug+i,u=o*Ug+n,d=a*Ug+s,p=Math.hypot(($g[2*h+0]+$g[2*u+0])/2-$g[2*d+0],($g[2*h+1]+$g[2*u+1])/2-$g[2*d+1])>=16;Gg[d]=Gg[d]||(p?1:0),e<1022&&(Gg[d]=Gg[d]||Gg[(r+c>>1)*Ug+(i+l>>1)]||Gg[(o+c>>1)*Ug+(n+l>>1)])}const n=new kl,o=new Jl;let s=0;function a(e,t){const i=t*Ug+e;return 0===qg[i]&&(n.emplaceBack($g[2*i+0],$g[2*i+1],e*uo/Vg,t*uo/Vg),qg[i]=++s),qg[i]-1}function l(e,t,i,r,n,s){const c=e+i>>1,h=t+r>>1;if(Math.abs(e-n)+Math.abs(t-s)>1&&Gg[h*Ug+c])l(n,s,e,t,c,h),l(i,r,n,s,c,h);else{const l=a(e,t),c=a(i,r),h=a(n,s);o.emplaceBack(l,c,h)}}return l(0,0,Vg,Vg,Vg,0),l(Vg,Vg,0,0,0,Vg),{vertices:n,indices:o}})(this.tileID.canonical,t);r=e.vertices,n=e.indices}else{r=new kl,n=new Jl;for(const{x:e,y:t}of i)r.emplaceBack(e,t,0,0);const e=Td(r.int16,void 0,4);for(let t=0;t0&&(a=e.ae.invert(new Float64Array(16),i.globeMatrix)),this._makeGlobeTileDebugBorderBuffer(t,n,i,o,a,s),this._makeGlobeTileDebugTextBuffer(t,n,i,o,a,s)}_globePoint(t,i,r,n,o,s,a){let l=ju(t,i,r);if(s){const o=1<.5?d=-1:u<-.5&&(d=1);let p=(t/uo+r.x)/o+d,f=(i/uo+r.y)/o;p=(p-c)*n._pixelsPerMercatorPixel+c,f=(f-h)*n._pixelsPerMercatorPixel+h;const m=[p*n.worldSize,f*n.worldSize,0];e.$.transformMat4(m,m,s),l=Ou(l,m,a)}return e.$.transformMat4(l,l,o)}_makeGlobeTileDebugBorderBuffer(e,t,i,r,n,o){const s=new Rl,a=new nc,l=new Ll,c=(e,c,h,u,d)=>{const p=(h-e)/(d-1),f=(u-c)/(d-1),m=s.length;for(let h=0;hc*e+t;for(let e=0;e=1;r--){const n=1===r?1:0,o=2===r?1:0;for(let r=0;r>>1^-(1&e[t]);return e}function gy(e,t){switch(t){case"uint32":return e;case"uint16":for(let t=0;t>4|(61440&i)>>8|(240&r)<<4|61440&r,e[t+1]=15&i|(3840&i)>>4|(15&r)<<8|(3840&r)<<4}return e;case"uint8":for(let t=0;t>6|(192&r)>>4|(192&n)>>2|192&o,e[t+1]=(48&i)>>4|(48&r)>>2|48&n|(48&o)<<2,e[t+2]=(12&i)>>2|12&r|(12&n)<<2|(12&o)<<4,e[t+3]=3&i|(3&r)<<2|(3&n)<<4|(3&o)<<6}return e;default:throw new Error(`Invalid pixel format, "${t}"`)}}var yy=Uint8Array,xy=Uint16Array,vy=Int32Array,by=new yy([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),wy=new yy([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Ty=new yy([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Ey=function(e,t){for(var i=new xy(31),r=0;r<31;++r)i[r]=t+=1<>1|(21845&Py)<<1;Cy[Py]=((65280&(zy=(61680&(zy=(52428&zy)>>2|(13107&zy)<<2))>>4|(3855&zy)<<4))>>8|(255&zy)<<8)>>1}var Dy=function(e,t,i){for(var r=e.length,n=0,o=new xy(t);n>l]=c;return s},Ry=new yy(288);for(Py=0;Py<144;++Py)Ry[Py]=8;for(Py=144;Py<256;++Py)Ry[Py]=9;for(Py=256;Py<280;++Py)Ry[Py]=7;for(Py=280;Py<288;++Py)Ry[Py]=8;var Ly=new yy(32);for(Py=0;Py<32;++Py)Ly[Py]=5;var ky=Dy(Ry,9),Oy=Dy(Ly,5),By=function(e){for(var t=e[0],i=1;it&&(t=e[i]);return t},Fy=function(e,t,i){var r=t/8|0;return(e[r]|e[r+1]<<8)>>(7&t)&i},Ny=function(e,t){var i=t/8|0;return(e[i]|e[i+1]<<8|e[i+2]<<16)>>(7&t)},Vy=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],Uy=function(e,t,i){var r=new Error(t||Vy[e]);if(r.code=e,Error.captureStackTrace&&Error.captureStackTrace(r,Uy),!i)throw r;return r},jy=new yy(0),$y="undefined"!=typeof TextDecoder&&new TextDecoder;try{$y.decode(jy,{stream:!0})}catch(e){}const Gy={gzip_data:"gzip"};class qy extends Error{constructor(e){super(e),this.name="MRTError"}}const Zy={0:"uint32",1:"uint32",2:"uint16",3:"uint8"},Wy={uint32:1,uint16:2,uint8:4},Hy={uint32:Uint32Array,uint16:Uint16Array,uint8:Uint8Array};let Xy,Yy;class Jy{constructor(e=5){this.x=NaN,this.y=NaN,this.z=NaN,this.layers={},this._cacheSize=e}getLayer(e){const t=this.layers[e];if(!t)throw new qy(`Layer '${e}' not found`);return t}getHeaderLength(e){const t=new Uint8Array(e),i=new DataView(e);if(13!==t[0])throw new qy("File is not a valid MRT.");return i.getUint32(1,!0)}parseHeader(e){const t=new Uint8Array(e),i=this.getHeaderLength(e);if(t.length= ${i} but got buffer of length ${t.length}`);const r=(function(e){return e.readFields(sy,{header_length:0,x:0,y:0,z:0,layers:[]},void 0)})(new Xy(t.subarray(0,i)));if(!isNaN(this.x)&&(this.x!==r.x||this.y!==r.y||this.z!==r.z))throw new qy(`Invalid attempt to parse header ${r.z}/${r.x}/${r.y} for tile ${this.z}/${this.x}/${this.y}`);this.x=r.x,this.y=r.y,this.z=r.z;for(const e of r.layers)this.layers[e.name]=new Ky(e,{cacheSize:this._cacheSize});return this}createDecodingTask(e){const t=[],i=this.getLayer(e.layerName);for(let r of e.blockIndices){const n=i.dataIndex[r],o=n.first_byte-e.firstByte,s=n.last_byte-e.firstByte;if(i._blocksInProgress.has(r))continue;const a={layerName:i.name,firstByte:o,lastByte:s,pixelFormat:i.pixelFormat,blockIndex:r,blockShape:[n.bands.length].concat(i.bandShape),buffer:i.buffer,codec:n.codec.codec,filters:n.filters.map((e=>e.filter))};i._blocksInProgress.add(r),t.push(a)}return new Qy(t,(()=>{t.forEach((e=>i._blocksInProgress.delete(e.blockIndex)))}),((e,r)=>{if(t.forEach((e=>i._blocksInProgress.delete(e.blockIndex))),e)throw e;r.forEach((e=>{this.getLayer(e.layerName).processDecodedData(e)}))}))}}class Ky{constructor({version:e,name:t,units:i,tilesize:r,pixel_format:n,buffer:o,data_index:s},a){if(this.version=e,1!==this.version)throw new qy(`Cannot parse raster layer encoded with MRT version ${e}`);this.name=t,this.units=i,this.tileSize=r,this.buffer=o,this.pixelFormat=Zy[n],this.dataIndex=s,this.bandShape=[r+2*o,r+2*o,Wy[this.pixelFormat]],this._decodedBlocks=new fy(a?a.cacheSize:5),this._blocksInProgress=new Set}get dimension(){return Wy[this.pixelFormat]}get cacheSize(){return this._decodedBlocks.capacity}getBandList(){return this.dataIndex.map((({bands:e})=>e)).flat()}processDecodedData(e){const t=e.blockIndex.toString();this._decodedBlocks.get(t)||this._decodedBlocks.put(t,e.data)}getBlockForBand(e){let t=0;switch(typeof e){case"string":for(const[i,r]of this.dataIndex.entries()){for(const[n,o]of r.bands.entries())if(o===e)return{bandIndex:t+n,blockIndex:i,blockBandIndex:n};t+=r.bands.length}break;case"number":for(const[i,r]of this.dataIndex.entries()){if(e>=t&&ethis.cacheSize)throw new qy(`Number of blocks to decode (${n.size}) exceeds cache size (${this.cacheSize}).`);return{layerName:this.name,firstByte:t,lastByte:i,blockIndices:r}}hasBand(e){const{blockIndex:t}=this.getBlockForBand(e);return t>=0}hasDataForBand(e){const{blockIndex:t}=this.getBlockForBand(e);return t>=0&&!!this._decodedBlocks.get(t.toString())}getBandView(e){const{blockIndex:t,blockBandIndex:i}=this.getBlockForBand(e),r=this._decodedBlocks.get(t.toString());if(!r)throw new qy(`Data for band ${JSON.stringify(e)} of layer "${this.name}" not decoded.`);const n=this.dataIndex[t],o=this.bandShape.reduce(((e,t)=>e*t),1),s=i*o,a=r.subarray(s,s+o);return{data:a,bytes:new Uint8Array(a.buffer).subarray(a.byteOffset,a.byteOffset+a.byteLength),tileSize:this.tileSize,buffer:this.buffer,pixelFormat:this.pixelFormat,dimension:this.dimension,offset:0!==n.offset?n.offset:n.deprecated_offset,scale:0!==n.scale?n.scale:n.deprecated_scale}}}Jy.setPbf=function(e){Xy=e};class Qy{constructor(e,t,i){this.tasks=e,this._onCancel=t,this._onComplete=i,this._finalized=!1}cancel(){this._finalized||(this._onCancel(),this._finalized=!0)}complete(e,t){this._finalized||(this._onComplete(e,t),this._finalized=!0)}}Jy.performDecoding=function(e,t){const i=new Uint8Array(e);return Promise.all(t.tasks.map((e=>{const{layerName:t,firstByte:r,lastByte:n,pixelFormat:o,blockShape:s,blockIndex:a,filters:l,codec:c}=e,h=i.subarray(r,n+1),u=new Uint32Array(s[0]*s[1]*s[2]);let d;if("gzip_data"!==c)throw new qy(`Unhandled codec: ${c}`);return d=(function(e,t){if(!globalThis.DecompressionStream&&"gzip_data"===t)return Promise.resolve(((o=(function(e){31==e[0]&&139==e[1]&&8==e[2]||Uy(6,"invalid gzip data");var t=e[3],i=10;4&t&&(i+=2+(e[10]|e[11]<<8));for(var r=(t>>3&1)+(t>>4&1);r>0;r-=!e[i++]);return i+(2&t)})(n=e))+8>n.length&&Uy(6,"invalid gzip data"),(function(e,t,i){var r=e.length;if(!r||t.f&&!t.l)return i||new yy(0);var n=!i,o=n||2!=t.i,s=t.i;n&&(i=new yy(3*r));var a,l,c=function(e){var t=i.length;if(e>t){var r=new yy(Math.max(2*t,e));r.set(i),i=r}},h=t.f||0,u=t.p||0,d=t.b||0,p=t.l,f=t.d,m=t.m,_=t.n,g=8*r;do{if(!p){h=Fy(e,u,1);var y=Fy(e,u+1,3);if(u+=3,!y){var x=e[(P=4+((u+7)/8|0))-4]|e[P-3]<<8,v=P+x;if(v>r){s&&Uy(0);break}o&&c(d+x),i.set(e.subarray(P,v),d),t.b=d+=x,t.p=u=8*v,t.f=h;continue}if(1==y)p=ky,f=Oy,m=9,_=5;else if(2==y){var b=Fy(e,u,31)+257,w=Fy(e,u+10,15)+4,T=b+Fy(e,u+5,31)+1;u+=14;for(var E=new yy(T),S=new yy(19),M=0;M>4)<16)E[M++]=P;else{var D=0,R=0;for(16==P?(R=3+Fy(e,u,3),u+=2,D=E[M-1]):17==P?(R=3+Fy(e,u,7),u+=3):18==P&&(R=11+Fy(e,u,127),u+=7);R--;)E[M++]=D}}var L=E.subarray(0,b),k=E.subarray(b);m=By(L),_=By(k),p=Dy(L,m),f=Dy(k,_)}else Uy(1);if(u>g){s&&Uy(0);break}}o&&c(d+131072);for(var O=(1<>4;if((u+=15&D)>g){s&&Uy(0);break}if(D||Uy(2),N<256)i[d++]=N;else{if(256==N){F=u,p=null;break}var V=N-254;N>264&&(V=Fy(e,u,(1<<($=by[M=N-257]))-1)+My[M],u+=$);var U=f[Ny(e,u)&B],j=U>>4;if(U||Uy(3),u+=15&U,k=Iy[j],j>3){var $=wy[j];k+=Ny(e,u)&(1<<$)-1,u+=$}if(u>g){s&&Uy(0);break}o&&c(d+131072);var G=d+V;if(da.length)&&(l=a.length),new yy(a.subarray(0,l))):i.subarray(0,d)})(n.subarray(o,-8),{i:2},new yy(((i=n)[(r=i.length)-4]|i[r-3]<<8|i[r-2]<<16|i[r-1]<<24)>>>0))));var i,r,n,o;const s=Gy[t];if(!s)throw new Error(`Unhandled codec: ${t}`);const a=new globalThis.DecompressionStream(s);return new Response(new Blob([e]).stream().pipeThrough(a)).arrayBuffer().then((e=>new Uint8Array(e)))})(h,c).then((e=>((function(e,t){e.readFields(dy,t)})(new Xy(e),u),new(0,Hy[o])(u.buffer)))),d.then((e=>{for(let t=l.length-1;t>=0;t--)switch(l[t]){case"delta_filter":my(e,s);break;case"zigzag_filter":_y(e);break;case"bitshuffle_filter":gy(e,o);break;default:throw new qy(`Unhandled filter "${l[t]}"`)}return{layerName:t,blockIndex:a,data:e}})).catch((e=>{throw e}))})))},Jy.setPbf(Om);class ex extends oy{constructor(e,t,i,r,n){super(e,t,i,r,n),this._workQueue=[],this._fetchQueue=[],this._isHeaderLoaded=!1}setTexture(e,t){const i=t.context,r=i.gl;this.texture=this.texture||t.getTileTexture(e.width),this.texture&&this.texture instanceof Fg?this.texture.update(e,{useMipmap:!1,premultiply:!1}):this.texture=new Fg(i,e,r.RGBA,{useMipmap:!1,premultiply:!1})}flushQueues(){for(;this._workQueue.length;)this._workQueue.pop()();for(;this._fetchQueue.length;)this._fetchQueue.pop()()}fetchHeader(e=16384,t){const i=this._mrt=new Jy(30),r=Object.assign({},this.requestParams,{headers:{Range:"bytes=0-"+(e-1)}});return this.entireBuffer=null,this.request=rr(r,((r,n,o,s)=>{if(r)t(r);else try{const r=i.getHeaderLength(n);if(r>e)return void(this.request=this.fetchHeader(r,t));i.parseHeader(n),this._isHeaderLoaded=!0;let a=0;for(const e of Object.values(i.layers))a=Math.max(a,e.dataIndex[e.dataIndex.length-1].last_byte);n.byteLength>=a&&(this.entireBuffer=n),t(null,this.entireBuffer||n,o,s)}catch(e){t(e)}})),this.request}fetchBand(e,t,i){const r=this._mrt;if(!this._isHeaderLoaded||!r)return void i(new Error("Tile header is not ready"));const n=this.actor;if(!n)return void i(new Error("Can't fetch tile band without an actor"));let o;const s=(r,n)=>{o.complete(r,n),r?i(r):(this.updateTextureDescriptor(e,t),i(null,this.textureDescriptor&&this.textureDescriptor.img))},a=(e,t)=>{if(e)return i(e);const r=n.send("decodeRasterArray",{buffer:t,task:o},s,void 0,!0);this._workQueue.push((()=>{r&&r.cancel(),o.cancel()}))},l=r.getLayer(e);if(!l)return void i(new Error(`Unknown sourceLayer "${e}"`));if(l.hasDataForBand(t))return this.updateTextureDescriptor(e,t),void i(null,this.textureDescriptor?this.textureDescriptor.img:null);const c=l.getDataRange([t]);if(o=r.createDecodingTask(c),!o||o.tasks.length)if(this.flushQueues(),this.entireBuffer)a(null,this.entireBuffer.slice(c.firstByte,c.lastByte+1));else{const e=Object.assign({},this.requestParams,{headers:{Range:`bytes=${c.firstByte}-${c.lastByte}`}}),t=rr(e,a);this._fetchQueue.push((()=>{t.cancel(),o.cancel()}))}else i(null)}updateNeeded(e,t){return(!this.textureDescriptor||this.textureDescriptor.band!==t||this.textureDescriptor.layer!==e)&&"errored"!==this.state}updateTextureDescriptor(e,t){if(!this._mrt)return;const i=this._mrt.getLayer(e);if(!i||!i.hasBand(t)||!i.hasDataForBand(t))return;const{bytes:r,tileSize:n,buffer:o,offset:s,scale:a}=i.getBandView(t),l=n+2*o,c={data:r,width:l,height:l},h=this.texture;h&&h instanceof Fg&&h.update(c,{useMipmap:!1,premultiply:!1}),this.textureDescriptor={layer:e,band:t,img:c,buffer:o,offset:s,tileSize:n,format:i.pixelFormat,mix:[a,256*a,65536*a,16777216*a]}}}class tx{constructor(e,t){this.max=e,this.onRemove=t,this.reset()}reset(){for(const e in this.data)for(const t of this.data[e])t.timeout&&clearTimeout(t.timeout),this.onRemove(t.value);return this.data={},this.order=[],this}add(e,t,i){const r=e.wrapped().key;void 0===this.data[r]&&(this.data[r]=[]);const n={value:t,timeout:void 0};if(void 0!==i&&(n.timeout=setTimeout((()=>{this.remove(e,n)}),i)),this.data[r].push(n),this.order.push(r),this.order.length>this.max){const e=this._getAndRemoveByKey(this.order[0]);e&&this.onRemove(e)}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 t=this.data[e].shift();return t.timeout&&clearTimeout(t.timeout),0===this.data[e].length&&delete this.data[e],this.order.splice(this.order.indexOf(e),1),t.value}getByKey(e){const t=this.data[e];return t?t[0].value:null}get(e){return this.has(e)?this.data[e.wrapped().key][0].value:null}remove(e,t){if(!this.has(e))return this;const i=e.wrapped().key,r=void 0===t?0:this.data[i].indexOf(t),n=this.data[i][r];return this.data[i].splice(r,1),n.timeout&&clearTimeout(n.timeout),0===this.data[i].length&&delete this.data[i],this.onRemove(n.value),this.order.splice(this.order.indexOf(i),1),this}setMaxSize(e){for(this.max=e;this.order.length>this.max;){const e=this._getAndRemoveByKey(this.order[0]);e&&this.onRemove(e)}return this}filter(e){const t=[];for(const i in this.data)for(const r of this.data[i])e(r.value)||t.push(r);for(const e of t)this.remove(e.value.tileID,e)}}class ix extends Br{constructor(e,t,i){super(),this.id=e,this._onlySymbols=i,t.on("data",(e=>{"source"===e.dataType&&"metadata"===e.sourceDataType&&(this._sourceLoaded=!0),this._sourceLoaded&&!this._paused&&"source"===e.dataType&&"content"===e.sourceDataType&&(this.reload(),this.transform&&this.update(this.transform))})),t.on("error",(()=>{this._sourceErrored=!0})),this._source=t,this._tiles={},this._cache=new tx(0,this._unloadTile.bind(this)),this._timers={},this._cacheTimers={},this._minTileCacheSize=t.minTileCacheSize,this._maxTileCacheSize=t.maxTileCacheSize,this._loadedParentTiles={},this.castsShadows=!1,this.tileCoverLift=0,this._coveredTiles={},this._shadowCasterTiles={},this._state=new Nm,this._isRaster="raster"===this._source.type||"raster-dem"===this._source.type||"raster-array"===this._source.type||"custom"===this._source.type&&"raster"===this._source._dataType}onAdd(e){this.map=e,this._minTileCacheSize=void 0===this._minTileCacheSize&&e?e._minTileCacheSize:this._minTileCacheSize,this._maxTileCacheSize=void 0===this._maxTileCacheSize&&e?e._maxTileCacheSize:this._maxTileCacheSize}loaded(){if(this._sourceErrored)return!0;if(!this._sourceLoaded)return!1;if(!this._source.loaded())return!1;for(const e in this._tiles){const t=this._tiles[e];if("loaded"!==t.state&&"errored"!==t.state)return!1}return!0}getSource(){return this._source}pause(){this._paused=!0}resume(){if(!this._paused)return;const e=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,e&&this.reload(),this.transform&&this.update(this.transform)}_loadTile(e,t){return e.isSymbolTile=this._onlySymbols,e.isExtraShadowCaster=this._shadowCasterTiles[e.tileID.key],this._source.loadTile(e,t)}_unloadTile(e){if(this._source.unloadTile)return this._source.unloadTile(e)}_abortTile(e){if(this._source.abortTile)return this._source.abortTile(e)}serialize(){return this._source.serialize()}prepare(e){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null);for(const t in this._tiles){const i=this._tiles[t];i.upload(e),i.prepare(this.map.style.imageManager,this.map?this.map.painter:null,this._source.scope)}}getIds(){return ti(this._tiles).map((e=>e.tileID)).sort(rx).map((e=>e.key))}getRenderableIds(e,t){const i=[];for(const r in this._tiles)this._isIdRenderable(+r,e,t)&&i.push(this._tiles[r]);return e?i.sort(((e,t)=>{const i=e.tileID,r=t.tileID,n=new Ut(i.canonical.x,i.canonical.y)._rotate(this.transform.angle),o=new Ut(r.canonical.x,r.canonical.y)._rotate(this.transform.angle);return i.overscaledZ-r.overscaledZ||o.y-n.y||o.x-n.x})).map((e=>e.tileID.key)):i.map((e=>e.tileID)).sort(rx).map((e=>e.key))}hasRenderableParent(e){const t=this.findLoadedParent(e,0);return!!t&&this._isIdRenderable(t.tileID.key)}_isIdRenderable(e,t,i){return this._tiles[e]&&this._tiles[e].hasData()&&!this._coveredTiles[e]&&(t||!this._tiles[e].holdingForFade())&&(i||!this._shadowCasterTiles[e])}reload(){if(this._paused)this._shouldReloadOnResume=!0;else{this._cache.reset();for(const e in this._tiles)"errored"!==this._tiles[e].state&&this._reloadTile(+e,"reloading")}}_reloadTile(e,t){const i=this._tiles[e];i&&("loading"!==i.state&&(i.state=t),this._loadTile(i,this._tileLoaded.bind(this,i,e,t)))}_tileLoaded(e,t,i,r){if(r)if(e.state="errored",404!==r.status)this._source.fire(new Lr(r,{tile:e}));else{if(this._source.fire(new Rr("data",{dataType:"source",sourceDataType:"error",sourceId:this._source.id,tile:e})),!(e.tileID.key in this._loadedParentTiles))return;if("raster-dem"===this._source.type&&this.usedForTerrain&&this.map.painter.terrain){const e=this.map.painter.terrain;this.update(this.transform,e.getScaledDemTileSize(),!0),e.resetTileLookupCache(this.id)}else this.update(this.transform)}else e.timeAdded=Li.now(),"expired"===i&&(e.refreshedUponExpiration=!0),this._setTileReloadTimer(t,e),"raster-dem"===this._source.type&&e.dem&&this._backfillDEM(e),this._state.initializeTileState(e,this.map?this.map.painter:null),this._source.fire(new Rr("data",{dataType:"source",tile:e,coord:e.tileID,sourceCacheId:this.id}))}_backfillDEM(e){const t=this.getRenderableIds();for(let r=0;r1||(Math.abs(i)>1&&(1===Math.abs(i+n)?i+=n:1===Math.abs(i-n)&&(i-=n)),t.dem&&e.dem&&(e.dem.backfillBorder(t.dem,i,r),e.neighboringTiles&&e.neighboringTiles[o]&&(e.neighboringTiles[o].backfilled=!0)))}}getTile(e){return this.getTileByID(e.key)}getTileByID(e){return this._tiles[e]}_retainLoadedChildren(e,t,i,r){for(const n in this._tiles){let o=this._tiles[n];if(r[n]||!o.hasData()||o.tileID.overscaledZ<=t||o.tileID.overscaledZ>i)continue;let s=o.tileID;for(;o&&o.tileID.overscaledZ>t+1;){const e=o.tileID.scaledTo(o.tileID.overscaledZ-1);o=this._tiles[e.key],o&&o.hasData()&&(s=e)}let a=s;for(;a.overscaledZ>t;)if(a=a.scaledTo(a.overscaledZ-1),e[a.key]){r[s.key]=s;break}}}findLoadedParent(e,t){if(e.key in this._loadedParentTiles){const i=this._loadedParentTiles[e.key];return i&&i.tileID.overscaledZ>=t?i:null}for(let i=e.overscaledZ-1;i>=t;i--){const t=e.scaledTo(i),r=this._getLoadedTile(t);if(r)return r}}_getLoadedTile(e){const t=this._tiles[e.key];return t&&t.hasData()?t:this._cache.getByKey(this._source.reparseOverscaled?e.wrapped().key:e.canonical.key)}updateCacheSize(e,t){t=t||this._source.tileSize;const i=Math.ceil(e.width/t)+1,r=Math.ceil(e.height/t)+1,n=Math.floor(i*r*5),o="number"==typeof this._minTileCacheSize?Math.max(this._minTileCacheSize,n):n,s="number"==typeof this._maxTileCacheSize?Math.min(this._maxTileCacheSize,o):o;this._cache.setMaxSize(s)}handleWrapJump(e){const t=Math.round((e-(void 0===this._prevLng?e:this._prevLng))/360);if(this._prevLng=e,t){const e={};for(const i in this._tiles){const r=this._tiles[i];r.tileID=r.tileID.unwrapTo(r.tileID.wrap+t),e[r.tileID.key]=r}this._tiles=e;for(const e in this._timers)clearTimeout(this._timers[e]),delete this._timers[e];for(const e in this._tiles)this._setTileReloadTimer(+e,this._tiles[e])}}update(e,t,i,r){if(this.transform=e,!this._sourceLoaded||this._paused||this.transform.freezeTileCoverage)return;if(this.usedForTerrain&&!i)return;this.updateCacheSize(e,t),"globe"!==this.transform.projection.name&&this.handleWrapJump(this.transform.center.lng),this._shadowCasterTiles={},this._coveredTiles={};const n="batched-model"===this._source.type;let o;if(this.used||this.usedForTerrain){if(this._source.tileID)o=e.getVisibleUnwrappedCoordinates(this._source.tileID).map((e=>new wh(e.canonical.z,e.wrap,e.canonical.z,e.canonical.x,e.canonical.y)));else if(0!==this.tileCoverLift){const r=e.clone();r.tileCoverLift=this.tileCoverLift,o=r.coveringTiles({tileSize:t||this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom&&!i,reparseOverscaled:this._source.reparseOverscaled,isTerrainDEM:this.usedForTerrain,calculateQuadrantVisibility:n}),this._source.minzoom<=1&&"globe"===e.projection.name&&(o.push(new wh(1,0,1,0,0)),o.push(new wh(1,0,1,1,0)),o.push(new wh(1,0,1,0,1)),o.push(new wh(1,0,1,1,1)))}else if(o=e.coveringTiles({tileSize:t||this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom&&!i,reparseOverscaled:this._source.reparseOverscaled,isTerrainDEM:this.usedForTerrain,calculateQuadrantVisibility:n}),this._source.hasTile){const e=this._source.hasTile.bind(this._source);o=o.filter((t=>e(t)))}}else o=[];if(o.length>0&&this.castsShadows&&r&&"globe"!==this.transform.projection.name&&!this.usedForTerrain&&!nx(this._source.type)){const s=e.coveringZoomLevel({tileSize:t||this._source.tileSize,roundZoom:this._source.roundZoom&&!i}),a=Math.min(s,this._source.maxzoom);if(n){const t=e.extendTileCover(o,a);for(const e of t)o.push(e)}else{const t=e.extendTileCover(o,a,r);for(const e of t)this._shadowCasterTiles[e.key]=!0,o.push(e)}}const s=this._updateRetainedTiles(o);if(nx(this._source.type)&&0!==o.length){const e={},t={},i=Object.keys(s);for(const r of i){const i=s[r],n=this._tiles[r];if(!n||n.fadeEndTime&&n.fadeEndTime<=Li.now())continue;const o=this.findLoadedParent(i,Math.max(i.overscaledZ-ix.maxOverzooming,this._source.minzoom));o&&(this._addTile(o.tileID),e[o.tileID.key]=o.tileID),t[r]=i}const r=o[o.length-1].overscaledZ;for(const e in this._tiles){const i=this._tiles[e];if(s[e]||!i.hasData())continue;let n=i.tileID;for(;n.overscaledZ>r;){n=n.scaledTo(n.overscaledZ-1);const r=this._tiles[n.key];if(r&&r.hasData()&&t[n.key]){s[e]=i.tileID;break}}}for(const t in e)s[t]||(this._coveredTiles[t]=!0,s[t]=e[t])}for(const e in s)this._tiles[e].clearFadeHold();const a=(function(e,t){const i=[];for(const r in e)r in t||i.push(r);return i})(this._tiles,s);for(const e of a){const t=this._tiles[e];t.hasSymbolBuckets&&!t.holdingForFade()?t.setHoldDuration(this.map._fadeDuration):t.hasSymbolBuckets&&!t.symbolFadeFinished()||this._removeTile(+e)}this._updateLoadedParentTileCache(),this._onlySymbols&&this._source.afterUpdate&&this._source.afterUpdate()}releaseSymbolFadeTiles(){for(const e in this._tiles)this._tiles[e].holdingForFade()&&this._removeTile(+e)}_updateRetainedTiles(e){const t={};if(0===e.length)return t;const i={},r=e.reduce(((e,t)=>Math.min(e,t.overscaledZ)),1/0),n=e[0].overscaledZ,o=Math.max(n-ix.maxOverzooming,this._source.minzoom),s=Math.max(n+ix.maxUnderzooming,this._source.minzoom),a={};for(const i of e){const e=this._addTile(i);t[i.key]=i,e.hasData()||r=this._source.maxzoom){const e=r.children(this._source.maxzoom)[0],i=this.getTile(e);if(i&&i.hasData()){t[e.key]=e;continue}}else{const e=r.children(this._source.maxzoom);if(t[e[0].key]&&t[e[1].key]&&t[e[2].key]&&t[e[3].key])continue}let n=e.wasRequested();for(let s=r.overscaledZ-1;s>=o;--s){const o=r.scaledTo(s);if(i[o.key])break;if(i[o.key]=!0,e=this.getTile(o),!e&&n&&(e=this._addTile(o)),e&&(t[o.key]=o,n=e.wasRequested(),e.hasData()))break}}return t}_updateLoadedParentTileCache(){this._loadedParentTiles={};for(const e in this._tiles){const t=[];let i,r=this._tiles[e].tileID;for(;r.overscaledZ>0;){if(r.key in this._loadedParentTiles){i=this._loadedParentTiles[r.key];break}t.push(r.key);const e=r.scaledTo(r.overscaledZ-1);if(i=this._getLoadedTile(e),i)break;r=e}for(const e of t)this._loadedParentTiles[e]=i}}_addTile(e){let t=this._tiles[e.key];if(t)return!0!==t.isExtraShadowCaster||!!this._shadowCasterTiles[e.key]||this._reloadTile(e.key,"reloading"),t;t=this._cache.getAndRemove(e),t&&(this._setTileReloadTimer(e.key,t),t.tileID=e,this._state.initializeTileState(t,this.map?this.map.painter:null),this._cacheTimers[e.key]&&(clearTimeout(this._cacheTimers[e.key]),delete this._cacheTimers[e.key],this._setTileReloadTimer(e.key,t)));const i=Boolean(t);if(!i){const i=this.map?this.map.painter:null,r=this._source.tileSize*e.overscaleFactor();t="raster-array"===this._source.type?new ex(e,r,this.transform.tileZoom,i,this._isRaster):new oy(e,r,this.transform.tileZoom,i,this._isRaster),this._loadTile(t,this._tileLoaded.bind(this,t,e.key,t.state))}return t?(t.uses++,this._tiles[e.key]=t,i||this._source.fire(new Rr("dataloading",{tile:t,coord:t.tileID,dataType:"source"})),t):null}_setTileReloadTimer(e,t){e in this._timers&&(clearTimeout(this._timers[e]),delete this._timers[e]);const i=t.getExpiryTimeout();i&&(this._timers[e]=setTimeout((()=>{this._reloadTile(e,"expired"),delete this._timers[e]}),i))}_removeTile(e){const t=this._tiles[e];t&&(t.uses--,delete this._tiles[e],this._timers[e]&&(clearTimeout(this._timers[e]),delete this._timers[e]),t.uses>0||(t.hasData()&&"reloading"!==t.state||"empty"===t.state?this._cache.add(t.tileID,t,t.getExpiryTimeout()):(t.aborted=!0,this._abortTile(t),this._unloadTile(t))))}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(const e in this._tiles)this._removeTile(+e);this._source._clear&&this._source._clear(),this._cache.reset(),this.map&&this.usedForTerrain&&this.map.painter.terrain&&this.map.painter.terrain.resetTileLookupCache(this.id)}tilesIn(e,t,i){const r=[],n=this.transform;if(!n)return r;const o="globe"===n.projection.name,s=Ih(n.center.lng);for(const a in this._tiles){const l=this._tiles[a];if(i&&l.clearQueryDebugViz(),l.holdingForFade())continue;let c;if(o){const e=l.tileID.canonical;if(0===e.z){const t=[Math.abs(Jt(s,...ox(e,-1))-s),Math.abs(Jt(s,...ox(e,1))-s)];c=[0,2*t.indexOf(Math.min(...t))-1]}else{const t=[Math.abs(Jt(s,...ox(e,-1))-s),Math.abs(Jt(s,...ox(e,0))-s),Math.abs(Jt(s,...ox(e,1))-s)];c=[t.indexOf(Math.min(...t))-1]}}else c=[0];for(const i of c){const o=e.containsTile(l,n,t,i);o&&r.push(o)}}return r}getShadowCasterCoordinates(){return this._getRenderableCoordinates(!1,!0)}getVisibleCoordinates(e){return this._getRenderableCoordinates(e)}_getRenderableCoordinates(e,t){const i=this.getRenderableIds(e,t).map((e=>this._tiles[e].tileID)),r="globe"===this.transform.projection.name;for(const e of i)e.projMatrix=this.transform.calculateProjMatrix(e.toUnwrapped()),e.expandedProjMatrix=r?this.transform.calculateProjMatrix(e.toUnwrapped(),!1,!0):e.projMatrix;return i}sortCoordinatesByDistance(e){const t=e.slice(),i=this.transform._camera.position,r=this.transform._camera.forward(),n={};for(const e of t){const t=1/(1<n[e.key]-n[t.key])),t}hasTransition(){if(this._source.hasTransition())return!0;if(nx(this._source.type))for(const e in this._tiles){const t=this._tiles[e];if(void 0!==t.fadeEndTime&&t.fadeEndTime>=Li.now())return!0}return!1}setFeatureState(e,t,i){this._state.updateState(e=e||"_geojsonTileLayer",t,i)}removeFeatureState(e,t,i){this._state.removeFeatureState(e=e||"_geojsonTileLayer",t,i)}getFeatureState(e,t){return this._state.getState(e=e||"_geojsonTileLayer",t)}setDependencies(e,t,i){const r=this._tiles[e];r&&r.setDependencies(t,i)}reloadTilesForDependencies(e,t){for(const i in this._tiles)this._tiles[i].hasDependency(e,t)&&this._reloadTile(+i,"reloading");this._cache.filter((i=>!i.hasDependency(e,t)))}_preloadTiles(e,t){if(!this._sourceLoaded){const i=()=>{this._sourceLoaded&&(this._source.off("data",i),this._preloadTiles(e,t))};return void this._source.on("data",i)}const i=new Map,r=Array.isArray(e)?e:[e],n=this.map.painter.terrain,o=this.usedForTerrain&&n?n.getScaledDemTileSize():this._source.tileSize;for(const e of r){const t=e.coveringTiles({tileSize:o,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom&&!this.usedForTerrain,reparseOverscaled:this._source.reparseOverscaled,isTerrainDEM:this.usedForTerrain});for(const e of t)i.set(e.key,e);this.usedForTerrain&&e.updateElevation(!1)}ei(Array.from(i.values()),((e,t)=>{const i=new oy(e,this._source.tileSize*e.overscaleFactor(),this.transform.tileZoom,this.map.painter,this._isRaster);this._loadTile(i,(e=>{"raster-dem"===this._source.type&&i.dem&&this._backfillDEM(i),t(e,i)}))}),t)}}function rx(e,t){const i=Math.abs(2*e.wrap)-+(e.wrap<0),r=Math.abs(2*t.wrap)-+(t.wrap<0);return e.overscaledZ-t.overscaledZ||r-i||t.canonical.y-e.canonical.y||t.canonical.x-e.canonical.x}function nx(e){return"raster"===e||"image"===e||"video"===e||"custom"===e}function ox(e,t){const i=1<Yy||(Yy={layout:sm||(sm=new sl({"line-cap":new nl(al.layout_line["line-cap"]),"line-join":new nl(al.layout_line["line-join"]),"line-miter-limit":new rl(al.layout_line["line-miter-limit"]),"line-round-limit":new rl(al.layout_line["line-round-limit"]),"line-sort-key":new nl(al.layout_line["line-sort-key"]),"line-z-offset":new nl(al.layout_line["line-z-offset"]),visibility:new rl(al.layout_line.visibility)})),paint:am||(am=new sl({"line-opacity":new nl(al.paint_line["line-opacity"]),"line-color":new nl(al.paint_line["line-color"]),"line-translate":new rl(al.paint_line["line-translate"]),"line-translate-anchor":new rl(al.paint_line["line-translate-anchor"]),"line-width":new nl(al.paint_line["line-width"]),"line-gap-width":new nl(al.paint_line["line-gap-width"]),"line-offset":new nl(al.paint_line["line-offset"]),"line-blur":new nl(al.paint_line["line-blur"]),"line-dasharray":new nl(al.paint_line["line-dasharray"]),"line-pattern":new nl(al.paint_line["line-pattern"]),"line-gradient":new ol(al.paint_line["line-gradient"]),"line-trim-offset":new rl(al.paint_line["line-trim-offset"]),"line-trim-fade-range":new rl(al.paint_line["line-trim-fade-range"]),"line-trim-color":new rl(al.paint_line["line-trim-color"]),"line-emissive-strength":new rl(al.paint_line["line-emissive-strength"]),"line-border-width":new nl(al.paint_line["line-border-width"]),"line-border-color":new nl(al.paint_line["line-border-color"]),"line-occlusion-opacity":new rl(al.paint_line["line-occlusion-opacity"])}))},Yy);class ax extends nl{possiblyEvaluate(e,t){return t=new Ha(Math.floor(t.zoom),{now:t.now,fadeDuration:t.fadeDuration,transition:t.transition}),super.possiblyEvaluate(e,t)}evaluate(e,t,i,r){return t=ii({},t,{zoom:Math.floor(t.zoom)}),super.evaluate(e,t,i,r)}}let lx,cx,hx,ux;function dx(e,t){return t>0?t+2*e:e}class px{constructor(e){this.type=e.property.overrides?e.property.overrides.runtimeType:Jr,this.defaultValue=e}evaluate(e){if(e.formattedSection){const t=this.defaultValue.property.overrides;if(t&&t.hasOverride(e.formattedSection))return t.getOverride(e.formattedSection)}return e.feature&&e.featureState?this.defaultValue.evaluate(e.feature,e.featureState):this.defaultValue.property.specification.default}eachChild(e){this.defaultValue.isConstant()||e(this.defaultValue.value._styleExpression.expression)}outputDefined(){return!1}serialize(){return null}}wa(px,"FormatSectionOverride",{omit:["defaultValue"]});const fx=()=>ux||(ux={layout:cx||(cx=new sl({"symbol-placement":new rl(al.layout_symbol["symbol-placement"]),"symbol-spacing":new rl(al.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new rl(al.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new nl(al.layout_symbol["symbol-sort-key"]),"symbol-z-order":new rl(al.layout_symbol["symbol-z-order"]),"symbol-z-elevate":new rl(al.layout_symbol["symbol-z-elevate"]),"icon-allow-overlap":new rl(al.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new rl(al.layout_symbol["icon-ignore-placement"]),"icon-optional":new rl(al.layout_symbol["icon-optional"]),"icon-rotation-alignment":new rl(al.layout_symbol["icon-rotation-alignment"]),"icon-size":new nl(al.layout_symbol["icon-size"]),"icon-text-fit":new nl(al.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new nl(al.layout_symbol["icon-text-fit-padding"]),"icon-image":new nl(al.layout_symbol["icon-image"]),"icon-rotate":new nl(al.layout_symbol["icon-rotate"]),"icon-padding":new rl(al.layout_symbol["icon-padding"]),"icon-keep-upright":new rl(al.layout_symbol["icon-keep-upright"]),"icon-offset":new nl(al.layout_symbol["icon-offset"]),"icon-anchor":new nl(al.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new rl(al.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new rl(al.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new rl(al.layout_symbol["text-rotation-alignment"]),"text-field":new nl(al.layout_symbol["text-field"]),"text-font":new nl(al.layout_symbol["text-font"]),"text-size":new nl(al.layout_symbol["text-size"]),"text-max-width":new nl(al.layout_symbol["text-max-width"]),"text-line-height":new nl(al.layout_symbol["text-line-height"]),"text-letter-spacing":new nl(al.layout_symbol["text-letter-spacing"]),"text-justify":new nl(al.layout_symbol["text-justify"]),"text-radial-offset":new nl(al.layout_symbol["text-radial-offset"]),"text-variable-anchor":new rl(al.layout_symbol["text-variable-anchor"]),"text-anchor":new nl(al.layout_symbol["text-anchor"]),"text-max-angle":new rl(al.layout_symbol["text-max-angle"]),"text-writing-mode":new rl(al.layout_symbol["text-writing-mode"]),"text-rotate":new nl(al.layout_symbol["text-rotate"]),"text-padding":new rl(al.layout_symbol["text-padding"]),"text-keep-upright":new rl(al.layout_symbol["text-keep-upright"]),"text-transform":new nl(al.layout_symbol["text-transform"]),"text-offset":new nl(al.layout_symbol["text-offset"]),"text-allow-overlap":new rl(al.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new rl(al.layout_symbol["text-ignore-placement"]),"text-optional":new rl(al.layout_symbol["text-optional"]),visibility:new rl(al.layout_symbol.visibility)})),paint:hx||(hx=new sl({"icon-opacity":new nl(al.paint_symbol["icon-opacity"]),"icon-occlusion-opacity":new nl(al.paint_symbol["icon-occlusion-opacity"]),"icon-emissive-strength":new nl(al.paint_symbol["icon-emissive-strength"]),"text-emissive-strength":new nl(al.paint_symbol["text-emissive-strength"]),"icon-color":new nl(al.paint_symbol["icon-color"]),"icon-halo-color":new nl(al.paint_symbol["icon-halo-color"]),"icon-halo-width":new nl(al.paint_symbol["icon-halo-width"]),"icon-halo-blur":new nl(al.paint_symbol["icon-halo-blur"]),"icon-translate":new rl(al.paint_symbol["icon-translate"]),"icon-translate-anchor":new rl(al.paint_symbol["icon-translate-anchor"]),"icon-image-cross-fade":new nl(al.paint_symbol["icon-image-cross-fade"]),"text-opacity":new nl(al.paint_symbol["text-opacity"]),"text-occlusion-opacity":new nl(al.paint_symbol["text-occlusion-opacity"]),"text-color":new nl(al.paint_symbol["text-color"],{runtimeType:tn,getOverride:e=>e.textColor,hasOverride:e=>!!e.textColor}),"text-halo-color":new nl(al.paint_symbol["text-halo-color"]),"text-halo-width":new nl(al.paint_symbol["text-halo-width"]),"text-halo-blur":new nl(al.paint_symbol["text-halo-blur"]),"text-translate":new rl(al.paint_symbol["text-translate"]),"text-translate-anchor":new rl(al.paint_symbol["text-translate-anchor"]),"icon-color-saturation":new rl(al.paint_symbol["icon-color-saturation"]),"icon-color-contrast":new rl(al.paint_symbol["icon-color-contrast"]),"icon-color-brightness-min":new rl(al.paint_symbol["icon-color-brightness-min"]),"icon-color-brightness-max":new rl(al.paint_symbol["icon-color-brightness-max"])}))},ux);class mx extends Al{constructor(t,i,r,n){super(t,fx(),i,r,n),this._colorAdjustmentMatrix=e.ae.identity([]),this.hasInitialOcclusionOpacityProperties=void 0!==t.paint&&("icon-occlusion-opacity"in t.paint||"text-occlusion-opacity"in t.paint)}recalculate(e,t){super.recalculate(e,t),"auto"===this.layout.get("icon-rotation-alignment")&&(this.layout._values["icon-rotation-alignment"]="point"!==this.layout.get("symbol-placement")?"map":"viewport"),"auto"===this.layout.get("text-rotation-alignment")&&(this.layout._values["text-rotation-alignment"]="point"!==this.layout.get("symbol-placement")?"map":"viewport"),"auto"===this.layout.get("text-pitch-alignment")&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")),"auto"===this.layout.get("icon-pitch-alignment")&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment"));const i=this.layout.get("text-writing-mode");if(i){const e=[];for(const t of i)e.indexOf(t)<0&&e.push(t);this.layout._values["text-writing-mode"]=e}else this.layout._values["text-writing-mode"]="point"===this.layout.get("symbol-placement")?["horizontal"]:["horizontal","vertical"];this._setPaintOverrides()}getColorAdjustmentMatrix(t,i,r,n){return this._saturation===t&&this._contrast===i&&this._brightnessMin===r&&this._brightnessMax===n||(this._colorAdjustmentMatrix=(function(t,i,r,n){t=Di(t),i=zi(i);const o=e.ae.create(),s=t/3,a=1-2*s,l=[a,s,s,0,s,a,s,0,s,s,a,0,0,0,0,1],c=.5-.5*i,h=n-r;return e.ae.multiply(o,[h,0,0,0,0,h,0,0,0,0,h,0,r,r,r,1],[i,0,0,0,0,i,0,0,0,0,i,0,c,c,c,1]),e.ae.multiply(o,o,l),o})(t,i,r,n),this._saturation=t,this._contrast=i,this._brightnessMin=r,this._brightnessMax=n),this._colorAdjustmentMatrix}getValueAndResolveTokens(e,t,i,r){const n=this.layout.get(e).evaluate(t,{},i,r),o=this._unevaluatedLayout._values[e];return o.isDataDriven()||ha(o.value)||!n?n:(function(e,t){return t.replace(/{([^{}]+)}/g,((t,i)=>i in e?String(e[i]):""))})(t.properties,n)}createBucket(e){return new Bg(e)}queryRadius(){return 0}queryIntersectsFeature(){return!1}_setPaintOverrides(){for(const e of fx().paint.overridableProperties){if(!mx.hasPaintOverride(this.layout,e))continue;const t=this.paint.get(e),i=new px(t),r=new ca(i,t.property.specification,this.scope,this.options);let n=null;n="constant"===t.value.kind||"source"===t.value.kind?new da("source",r):new pa("composite",r,t.value.zoomStops,t.value._interpolationType),this.paint._values[e]=new tl(t.property,n,t.parameters)}}_handleOverridablePaintPropertyUpdate(e,t,i){return!(!this.layout||t.isDataDriven()||i.isDataDriven())&&mx.hasPaintOverride(this.layout,e)}static hasPaintOverride(e,t){const i=e.get("text-field"),r=fx().paint.properties[t];let n=!1;const o=e=>{for(const t of e)if(r.overrides&&r.overrides.hasOverride(t))return void(n=!0)};if("constant"===i.value.kind&&i.value.value instanceof _n)o(i.value.value.sections);else if("source"===i.value.kind){const e=t=>{n||(t instanceof wn&&vn(t.value)===sn?o(t.value.sections):t instanceof Mn?o(t.sections):t.eachChild(e))},t=i.value;t._styleExpression&&e(t._styleExpression.expression)}return n}getProgramIds(){const e=0!==this.paint.get("icon-opacity").constantOr(1),t=0!==this.paint.get("text-opacity").constantOr(1),i=[];return e&&i.push("symbolIcon"),t&&i.push("symbolSDF"),i}getDefaultProgramParams(e,t,i){return{config:new Jc(this,{zoom:t,lut:i}),overrideFog:!1}}}let _x,gx,yx,xx;function vx(t,i,r,n,o,s,a,l){const c=[t,i,1,r,n,1,o,s,1],h=[a,l,1],u=e.bE.adjoint([],c),[d,p,f]=e.$.transformMat3(h,h,u);return e.bE.multiply(c,c,[d,0,0,0,p,0,0,0,f])}function bx(t,i,r,n,o,s,a,l){const c=(function(t,i,r,n,o,s,a,l){const c=vx(0,0,1,0,1,1,0,1),h=vx(t,i,r,n,o,s,a,l),u=e.bE.adjoint([],c);return e.bE.multiply(h,h,u)})(t,i,r,n,o,s,a,l);return[c[2]/c[8]/uo,c[5]/c[8]/uo]}function wx(e){return[e[0],Math.min(Math.max(e[1],-85.051129),Lh)]}class Tx extends Br{constructor(e,t,i,r){super(),this.id=e,this.dispatcher=i,this.coordinates=t.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.onNorthPole=!1,this.onSouthPole=!1,this.setEventedParent(r),this.options=t,this._dirty=!1}load(e,t){if(this._loaded=t||!1,this.fire(new Rr("dataloading",{dataType:"source"})),this.url=this.options.url,!this.url)return e&&(this.coordinates=e),this._loaded=!0,void this._finishLoading();this._imageRequest=lr(this.map._requestManager.transformRequest(this.url,Qi.Image),((t,i)=>{this._imageRequest=null,this._loaded=!0,t?this.fire(new Lr(t)):i&&(this.image=i instanceof HTMLImageElement?Li.getImageData(i):i,this._dirty=!0,this.width=this.image.width,this.height=this.image.height,e&&(this.coordinates=e),this._finishLoading())}))}loaded(){return this._loaded}updateImage(e){return e.url?(this._imageRequest&&e.url!==this.options.url&&(this._imageRequest.cancel(),this._imageRequest=null),this.options.url=e.url,this.load(e.coordinates,this._loaded),this):this}setTexture(e){if(!(e.handle instanceof WebGLTexture))throw new Error("The provided handle is not a WebGLTexture instance");return this.texture=new Ng(this.map.painter.context,e.handle),this.width=e.dimensions[0],this.height=e.dimensions[1],this._dirty=!1,this._loaded=!0,this._finishLoading(),this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new Rr("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(e){this.map=e,this.load()}onRemove(e){this._imageRequest&&(this._imageRequest.cancel(),this._imageRequest=null),!this.texture||this.texture instanceof Ng||this.texture.destroy(),this.boundsBuffer&&(this.boundsBuffer.destroy(),this.elevatedGlobeVertexBuffer&&this.elevatedGlobeVertexBuffer.destroy(),this.elevatedGlobeIndexBuffer&&this.elevatedGlobeIndexBuffer.destroy())}setCoordinates(e){if(this.coordinates=e,this._boundsArray=void 0,this._unsupportedCoords=!1,!e.length)return this;this.onNorthPole=!1,this.onSouthPole=!1;let t=e[0][1],i=e[0][1];for(const r of e)r[1]>i&&(i=r[1]),r[1]Lh?this.onNorthPole=!0:r<-85.051129&&(this.onSouthPole=!0),!this.onNorthPole&&!this.onSouthPole){const t=e.map(Nh.fromLngLat);this.tileID=(function(e){let t=1/0,i=1/0,r=-1/0,n=-1/0;for(const o of e)t=Math.min(t,o.x),i=Math.min(i,o.y),r=Math.max(r,o.x),n=Math.max(n,o.y);const o=Math.max(r-t,n-i),s=Math.max(0,Math.floor(-Math.log(o)/Math.LN2)),a=Math.pow(2,s);let l=Math.floor((t+r)/2*a);return l>1&&(l-=1),new vh(s,l,Math.floor((i+n)/2*a))})(t),this.minzoom=this.maxzoom=this.tileID.z}return this.fire(new Rr("data",{dataType:"source",sourceDataType:"content"})),this}_clear(){this._boundsArray=void 0,this._unsupportedCoords=!1}_prepareData(t){for(const e in this.tiles){const t=this.tiles[e];"loaded"!==t.state&&(t.state="loaded",t.texture=this.texture)}if(this._boundsArray||this.onNorthPole||this.onSouthPole||this._unsupportedCoords)return;const i=og(new vh(0,0,0),this.map.transform.projection),r=[i.projection.project(this.coordinates[0][0],this.coordinates[0][1]),i.projection.project(this.coordinates[1][0],this.coordinates[1][1]),i.projection.project(this.coordinates[2][0],this.coordinates[2][1]),i.projection.project(this.coordinates[3][0],this.coordinates[3][1])];if(!(function(e){const t=e[1].x-e[0].x,i=e[1].y-e[0].y,r=e[2].x-e[1].x,n=e[2].y-e[1].y,o=e[3].x-e[2].x,s=e[3].y-e[2].y,a=e[0].x-e[3].x,l=e[0].y-e[3].y,c=t*n-r*i,h=r*s-o*n,u=o*l-a*s,d=a*i-t*l;return c>0&&h>0&&u>0&&d>0||c<0&&h<0&&u<0&&d<0})(r))return console.warn("Image source coordinates are defining non-convex area in the Mercator projection"),void(this._unsupportedCoords=!0);const n=og(this.tileID,this.map.transform.projection),[o,s,a,l]=this.coordinates.map((e=>{const t=n.projection.project(e[0],e[1]);return sg(n,t)._round()}));this.perspectiveTransform=bx(o.x,o.y,s.x,s.y,a.x,a.y,l.x,l.y);const c=this._boundsArray=new kl;c.emplaceBack(o.x,o.y,0,0),c.emplaceBack(s.x,s.y,uo,0),c.emplaceBack(l.x,l.y,0,uo),c.emplaceBack(a.x,a.y,uo,uo),this.boundsBuffer&&(this.boundsBuffer.destroy(),this.elevatedGlobeVertexBuffer&&this.elevatedGlobeVertexBuffer.destroy(),this.elevatedGlobeIndexBuffer&&this.elevatedGlobeIndexBuffer.destroy()),this.boundsBuffer=t.createVertexBuffer(c,Wg.members),this.boundsSegments=Sc.simpleSegment(0,0,4,2);const h=[],u=(function(e){return[wx(e[0]),wx(e[1]),wx(e[2]),wx(e[3])]})(this.coordinates),[d,p,f,m]=(function(e){let t=e[0][0],i=t,r=e[0][1],n=r;for(let o=1;oi&&(i=e[o][0]),e[o][1]n&&(n=e[o][1]);return[t,r,i-t,n-r]})(u);{const n=new kl,[o,s,a,l]=(function(e){let t=e[0].x,i=t,r=e[0].y,n=r;for(let o=1;oi&&(i=e[o].x),e[o].yn&&(n=e[o].y);return[t,r,i-t,n-r]})(r),c=e=>[(e.x-o)/a,(e.y-s)/l],[u,_,g,y]=r.map(c),x=(function(t,i,r,n,o,s,a,l){const c=vx(0,0,1,0,1,1,0,1),h=vx(t,i,r,n,o,s,a,l),u=e.bE.adjoint([],h);return e.bE.multiply(c,c,u)})(u[0],u[1],_[0],_[1],g[0],g[1],y[0],y[1]);this.elevatedGlobePerspectiveTransform=bx(u[0],u[1],_[0],_[1],g[0],g[1],y[0],y[1]);const v=(t,i)=>{h.push(t.lng);const r=Math.round((t.lng-d)/f*uo),o=Math.round((t.lat-p)/m*uo),s=c(i),a=e.$.transformMat3([],[s[0],s[1],1],x),l=Math.round(a[0]/a[2]*uo),u=Math.round(a[1]/a[2]*uo);n.emplaceBack(r,o,l,u)},b=r[3].x-r[0].x,w=r[3].y-r[0].y,T=r[2].x-r[1].x,E=r[2].y-r[1].y;for(let e=0;e<65;e++){const t=e/64,n=[r[0].x+t*b,r[0].y+t*w],o=[r[1].x+t*T,r[1].y+t*E],s=o[0]-n[0],a=o[1]-n[1];for(let e=0;e<65;e++){const t=e/64,r={x:n[0]+s*t,y:n[1]+a*t,z:0};v(i.projection.unproject(r.x,r.y),r)}}this.elevatedGlobeVertexBuffer=t.createVertexBuffer(n,Wg.members)}{this.maxLongitudeTriangleSize=0;let e=[],i=new Jl;const r=(t,r,n)=>{i.emplaceBack(t,r,n);const o=h[t],s=h[r],a=h[n],l=Math.min(Math.min(o,s),a),c=Math.max(Math.max(o,s),a)-l;c>this.maxLongitudeTriangleSize&&(this.maxLongitudeTriangleSize=c),e.push(l+c/2)};for(let e=0;e<64;e++)for(let t=0;t<64;t++){const i=65*e+t,n=i+1,o=i+65,s=o+1;r(i,o,n),r(n,o,s)}[e,i]=(function(e,t){const i=Array.from({length:e.length},((e,t)=>t));i.sort(((t,i)=>e[t]-e[i]));const r=[],n=new Jl;for(let o=0;o{o.segments.push({vertexOffset:0,primitiveOffset:e,vertexLength:t.segments[0].vertexLength,primitiveLength:i,sortKey:void 0,vaos:{}})},a=.51*this.maxLongitudeTriangleSize;if(Math.abs(i[0]-r)<=a){const e=Pi(i,0,i.length,r+a);return e===i.length||s(e,Ci(i,e+1,i.length,r+360-a)-e),o}r0){const r=(function(t,i){const r=i.worldSize,n=Ph(1,0)*r*Oh(i.center.lat,i.zoom)/Wu(r),o=Ph(1,i.center.lat)*r,s=e.ae.identity([]);return e.ae.rotateY(s,s,qt(i.center.lng)),e.ae.rotateX(s,s,qt(i.center.lat)),e.ae.translate(s,s,[0,0,nh]),e.ae.scale(s,s,[n,n,n*o]),e.ae.translate(s,s,[i.point.x-.5*r,i.point.y-.5*r,0]),e.ae.multiply(s,s,t),e.ae.multiply(s,i.globeMatrix,s)})(t,i);return(function(t,i,r){const n=(t,i,r)=>{const n=e.$.length(t),o=e.$.length(i),s=Ou(t,i,r);return e.$.scale(s,s,1/e.$.length(s)*qr(n,o,r))},o=n([t[0],t[1],t[2]],[i[0],i[1],i[2]],r),s=n([t[4],t[5],t[6]],[i[4],i[5],i[6]],r),a=n([t[8],t[9],t[10]],[i[8],i[9],i[10]],r),l=Ou([t[12],t[13],t[14]],[i[12],i[13],i[14]],r);return[o[0],o[1],o[2],0,s[0],s[1],s[2],0,a[0],a[1],a[2],0,l[0],l[1],l[2],1]})(o,r,n)}return o}function $x(e,t,i,r){const n=Su.projectAabbCorners(r,i);let o=Number.MAX_VALUE,s=-1;for(let e=0;enew Ut(n[e][0],n[e][1]);let l;switch(s){case 0:case 6:l=[a(1),a(5),a(4),a(7),a(3),a(2),a(1)];break;case 1:case 7:l=[a(0),a(4),a(5),a(6),a(2),a(3),a(0)];break;case 3:case 5:l=[a(1),a(0),a(4),a(7),a(6),a(2),a(1)];break;default:l=[a(1),a(5),a(6),a(7),a(3),a(0),a(1)]}if(Kh(e,l))return o}const Gx=zl([{name:"a_pos_3f",components:3,type:"Float32"}]),qx=zl([{name:"a_color_3f",components:3,type:"Float32"}]),Zx=zl([{name:"a_color_4f",components:4,type:"Float32"}]),Wx=zl([{name:"a_uv_2f",components:2,type:"Float32"}]),Hx=zl([{name:"a_normal_3f",components:3,type:"Float32"}]),Xx=zl([{name:"a_normal_matrix0",components:4,type:"Float32"},{name:"a_normal_matrix1",components:4,type:"Float32"},{name:"a_normal_matrix2",components:4,type:"Float32"},{name:"a_normal_matrix3",components:4,type:"Float32"}]),Yx=zl([{name:"a_pbr",components:4,type:"Uint16"},{name:"a_heightBasedEmissiveStrength",components:3,type:"Float32"}]);class Jx{constructor(e,t,i,r){this.message=(e?`${e}: `:"")+i,r&&(this.identifier=r),null!=t&&t.__line__&&(this.line=t.__line__)}}function Kx(e,t){const i=-1===e.indexOf("://");try{return new URL(e,i&&t?"http://example.com":void 0),!0}catch(e){return!1}}class Qx{constructor(e,t){this.feature=e,this.instancedDataOffset=t,this.instancedDataCount=0,this.rotation=[0,0,0],this.scale=[1,1,1],this.translation=[0,0,0]}}class ev{constructor(){this.instancedDataArray=new sc,this.instancesEvaluatedElevation=[],this.features=[],this.idToFeaturesIndex={}}}class tv{constructor(e){this.zoom=e.zoom,this.canonical=e.canonical,this.layers=e.layers,this.layerIds=this.layers.map((e=>e.fqid)),this.projection=e.projection,this.index=e.index,this.hasZoomDependentProperties=this.layers[0].isZoomDependent(),this.stateDependentLayerIds=this.layers.filter((e=>e.isStateDependent())).map((e=>e.id)),this.hasPattern=!1,this.instancesPerModel={},this.validForExaggeration=0,this.maxVerticalOffset=0,this.maxScale=0,this.maxHeight=0,this.lookupDim=this.zoom>this.canonical.z?256:this.zoom>15?75:100,this.instanceCount=0,this.terrainElevationMin=0,this.terrainElevationMax=0,this.validForDEMTile={id:null,timestamp:0},this.modelUris=[],this.modelsRequested=!1,this.activeReplacements=[],this.replacementUpdateTime=0}updateFootprints(e,t){}populate(e,t,i,r){this.tileToMeter=Fh(i);const n=this.layers[0]._featureFilter.needGeometry;this.lookup=new Uint8Array(this.lookupDim*this.lookupDim);for(const{feature:o,id:s,index:a,sourceLayerIndex:l}of e){const e=null!=s?s:o.properties&&o.properties.hasOwnProperty("id")?o.properties.id:void 0,c=Hh(o,n);if(!this.layers[0]._featureFilter.filter(new Ha(this.zoom),c,i))continue;const h={id:e,sourceLayerIndex:l,index:a,geometry:n?c.geometry:Wh(o,i,r),properties:o.properties,type:o.type,patterns:{}},u=this.addFeature(h,h.geometry,c);u&&t.featureIndex.insert(o,h.geometry,a,l,this.index,this.instancesPerModel[u].instancedDataArray.length,256)}this.lookup=null}update(e,t,i,r){for(const t in this.instancesPerModel){const i=this.instancesPerModel[t];for(const t in e)i.idToFeaturesIndex.hasOwnProperty(t)&&(this.evaluate(i.features[i.idToFeaturesIndex[t]],e[t],i,!0),this.uploaded=!1)}this.maxHeight=0}updateZoomBasedPaintProperties(){if(!this.hasZoomDependentProperties)return!1;let t=!1;for(const i in this.instancesPerModel){const r=this.instancesPerModel[i];for(const i of r.features){const n=this.layers[0],o=i.feature,s=this.canonical,a=n.paint.get("model-rotation").evaluate(o,{},s),l=n.paint.get("model-scale").evaluate(o,{},s),c=n.paint.get("model-translation").evaluate(o,{},s);e.$.exactEquals(i.rotation,a)&&e.$.exactEquals(i.scale,l)&&e.$.exactEquals(i.translation,c)||(this.evaluate(i,i.featureStates,r,!0),t=!0)}}return t}updateReplacement(e,t,i,r){if(t.updateTime===this.replacementUpdateTime)return!1;this.replacementUpdateTime=t.updateTime;const n=t.getReplacementRegionsForTile(e.toUnwrapped(),!0);if(Bp(this.activeReplacements,n))return!1;this.activeReplacements=n;let o=!1;for(const t in this.instancesPerModel){const n=this.instancesPerModel[t],s=n.instancedDataArray;for(const t of n.features){const n=t.instancedDataOffset,a=t.instancedDataCount;for(let t=0;tuo?l-uo:l;const c=Math.floor(l),h=s.float32[a+1];let u=!1;for(const t of this.activeReplacements)if(!Rp(t,i,nf.Model,r)&&!(t.min.x>c||c>t.max.x||t.min.y>h||h>t.max.y)&&(u=$p(jp(c,h,e.canonical,t.footprintTileId.canonical),t),u))break;s.float32[a]=u?l+uo:l,o=o||u}}}return o}isEmpty(){for(const e in this.instancesPerModel)if(0!==this.instancesPerModel[e].instancedDataArray.length)return!1;return!0}uploadPending(){return!this.uploaded}upload(e){if(!this.uploaded)for(const t in this.instancesPerModel){const i=this.instancesPerModel[t];i.instancedDataArray.length<0||0===i.instancedDataArray.length||(i.instancedDataBuffer?i.instancedDataBuffer.updateData(i.instancedDataArray):i.instancedDataBuffer=e.createVertexBuffer(i.instancedDataArray,Xx.members,!0,void 0,this.instanceCount))}this.uploaded=!0}destroy(){for(const e in this.instancesPerModel){const t=this.instancesPerModel[e];0!==t.instancedDataArray.length&&t.instancedDataBuffer&&t.instancedDataBuffer.destroy()}const e=this.layers[0].modelManager;if(e&&this.modelUris)for(const t of this.modelUris)e.removeModel(t,"")}addFeature(e,t,i){const r=this.layers[0],n=r.layout.get("model-id").evaluate(i,{},this.canonical);if(!n)return fi(`modelId is not evaluated for layer ${r.id} and it is not going to get rendered.`),n;Kx(n,!1)&&(this.modelUris.includes(n)||this.modelUris.push(n)),this.instancesPerModel[n]||(this.instancesPerModel[n]=new ev);const o=this.instancesPerModel[n],s=o.instancedDataArray,a=new Qx(i,s.length);for(const e of t)for(const t of e){if(t.x<0||t.x>=uo||t.y<0||t.y>=uo)continue;const e=(this.lookupDim-1)/uo,i=this.lookupDim*(t.y*e|0)+t.x*e|0;if(this.lookup){if(0!==this.lookup[i])continue;this.lookup[i]=1}this.instanceCount++;const r=s.length;s.resize(r+1),o.instancesEvaluatedElevation.push(0),s.float32[16*r]=t.x,s.float32[16*r+1]=t.y}return a.instancedDataCount=o.instancedDataArray.length-a.instancedDataOffset,a.instancedDataCount>0&&(e.id&&(o.idToFeaturesIndex[e.id]=o.features.length),o.features.push(a),this.evaluate(a,{},o,!1)),n}getModelUris(){return this.modelUris}evaluate(e,t,i,r){const n=this.layers[0],o=e.feature,s=this.canonical,a=e.rotation=n.paint.get("model-rotation").evaluate(o,t,s),l=e.scale=n.paint.get("model-scale").evaluate(o,t,s),c=e.translation=n.paint.get("model-translation").evaluate(o,t,s),h=n.paint.get("model-color").evaluate(o,t,s);h.a=n.paint.get("model-color-mix-intensity").evaluate(o,t,s);const u=[];this.maxVerticalOffset10?this.tileToMeter:Fh(s,p)),a[o+4]=c[0],a[o+5]=c[1],a[o+6]=c[2]+l,a[o+7]=u[0],a[o+8]=u[1],a[o+9]=u[2],a[o+10]=u[4],a[o+11]=u[5],a[o+12]=u[6],a[o+13]=u[8],a[o+14]=u[9],a[o+15]=u[10],i.instancesEvaluatedElevation[n]=c[2]}}}let iv,rv;wa(tv,"ModelBucket",{omit:["layers"]}),wa(ev,"PerModelAttributes"),wa(Qx,"ModelFeature");const nv=64,ov={CoordinateSpaceTile:1,CoordinateSpaceYUp:2,HasMapboxMeshFeatures:4,HasMeshoptCompression:8};function sv(t,i,r,n,o,s,a,l,c,h=!1){const u=r.zoom,d=r.project(n),p=Oh(n.lat,u),f=1/p;e.ae.identity(t),e.ae.translate(t,t,[d.x+a[0]*f,d.y+a[1]*f,a[2]]);let m=1,_=1;const g=r.worldSize;if(h){if("mercator"===r.projection.name){let t=0;r.elevation&&(t=r.elevation.getAtPointOrZero(new Nh(d.x/g,d.y/g),0));const i=e.aB.transformMat4([],[d.x,d.y,t,1],r.projMatrix)[3]/r.cameraToCenterDistance;m=i,_=i*Oh(r.center.lat,u)}else if("globe"===r.projection.name){const i=jx(t,r),o=e.ae.multiply([],r.projMatrix,i),s=[0,0,0,1];e.aB.transformMat4(s,s,o);const a=s[3]/r.cameraToCenterDistance,l=Yu(u),c=r.projection.pixelsPerMeter(n.lat,g)*Oh(n.lat,u),h=r.projection.pixelsPerMeter(r.center.lat,g)*Oh(r.center.lat,u);m=a/qr(c,kh(r.center.lat),l),_=a*p/c,m*=h,_*=h}}else m=f;e.ae.scale(t,t,[m,m,_]);const y=[...t],x=i.orientation,v=[];if(Vx(v,[x[0]+o[0],x[1]+o[1],x[2]+o[2]],s),e.ae.multiply(t,y,v),l&&r.elevation){let o=0;const s=[];if(c&&r.elevation){o=(function(t,i,r,n,o){const s=i.elevation;if(!s)return 0;const a=Su.projectAabbCorners(r,n),l=Ph(1,o.lat)*i.worldSize,c=(function(t,i){const r=[0,0,1],n=[{corners:[0,1,3,2],dotProductWithUp:0},{corners:[1,5,2,6],dotProductWithUp:0},{corners:[0,4,1,5],dotProductWithUp:0},{corners:[2,6,3,7],dotProductWithUp:0},{corners:[4,7,5,6],dotProductWithUp:0},{corners:[0,3,4,7],dotProductWithUp:0}];for(const o of n){const n=t[o.corners[0]],s=t[o.corners[1]],a=t[o.corners[2]],l=[s[0]-n[0],s[1]-n[1],i*(s[2]-n[2])],c=e.$.cross(l,l,[a[0]-n[0],a[1]-n[1],i*(a[2]-n[2])]);e.$.normalize(c,c),o.dotProductWithUp=e.$.dot(c,r)}return n.sort(((e,t)=>e.dotProductWithUp-t.dotProductWithUp)),n[0].corners})(a,l),h=a[c[0]],u=a[c[1]],d=a[c[2]],p=a[c[3]],f=s.getAtPointOrZero(new Nh(h[0]/i.worldSize,h[1]/i.worldSize),0),m=s.getAtPointOrZero(new Nh(u[0]/i.worldSize,u[1]/i.worldSize),0),_=s.getAtPointOrZero(new Nh(d[0]/i.worldSize,d[1]/i.worldSize),0),g=s.getAtPointOrZero(new Nh(p[0]/i.worldSize,p[1]/i.worldSize),0),y=(f+g)/2,x=(m+_)/2;return y>x?m<_?Ux(t,u,p,h,m,g,f,l):Ux(t,d,h,p,_,f,g,l):f=t.gl.NEAREST_MIPMAP_NEAREST}),e.uploaded=!0,e.image=null)}function lv(e,t,i){e.indexBuffer=t.createIndexBuffer(e.indexArray,!1,!0),e.vertexBuffer=t.createVertexBuffer(e.vertexArray,Gx.members,!1,!0),e.normalArray&&(e.normalBuffer=t.createVertexBuffer(e.normalArray,Hx.members,!1,!0)),e.texcoordArray&&(e.texcoordBuffer=t.createVertexBuffer(e.texcoordArray,Wx.members,!1,!0)),e.colorArray&&(e.colorBuffer=t.createVertexBuffer(e.colorArray,(12===e.colorArray.bytesPerElement?qx:Zx).members,!1,!0)),e.featureArray&&(e.pbrBuffer=t.createVertexBuffer(e.featureArray,Yx.members,!0)),e.segments=Sc.simpleSegment(0,0,e.vertexArray.length,e.indexArray.length);const r=e.material;r.pbrMetallicRoughness.baseColorTexture&&av(r.pbrMetallicRoughness.baseColorTexture,t),r.pbrMetallicRoughness.metallicRoughnessTexture&&av(r.pbrMetallicRoughness.metallicRoughnessTexture,t),r.normalTexture&&av(r.normalTexture,t),r.occlusionTexture&&av(r.occlusionTexture,t,i),r.emissionTexture&&av(r.emissionTexture,t)}function cv(e,t,i){if(e.meshes)for(const r of e.meshes)lv(r,t,i);if(e.children)for(const r of e.children)cv(r,t,i)}function hv(e){if(e.meshes)for(const t of e.meshes)t.indexArray.destroy(),t.vertexArray.destroy(),t.colorArray&&t.colorArray.destroy(),t.normalArray&&t.normalArray.destroy(),t.texcoordArray&&t.texcoordArray.destroy(),t.featureArray&&t.featureArray.destroy();if(e.children)for(const t of e.children)hv(t)}function uv(e){if(e.meshes)for(const i of e.meshes)i.vertexBuffer&&(i.vertexBuffer.destroy(),i.indexBuffer.destroy(),i.normalBuffer&&i.normalBuffer.destroy(),i.texcoordBuffer&&i.texcoordBuffer.destroy(),i.colorBuffer&&i.colorBuffer.destroy(),i.pbrBuffer&&i.pbrBuffer.destroy(),i.segments.destroy(),i.material&&((t=i.material).pbrMetallicRoughness.baseColorTexture&&t.pbrMetallicRoughness.baseColorTexture.gfxTexture&&t.pbrMetallicRoughness.baseColorTexture.gfxTexture.destroy(),t.pbrMetallicRoughness.metallicRoughnessTexture&&t.pbrMetallicRoughness.metallicRoughnessTexture.gfxTexture&&t.pbrMetallicRoughness.metallicRoughnessTexture.gfxTexture.destroy(),t.normalTexture&&t.normalTexture.gfxTexture&&t.normalTexture.gfxTexture.destroy(),t.emissionTexture&&t.emissionTexture.gfxTexture&&t.emissionTexture.gfxTexture.destroy(),t.occlusionTexture&&t.occlusionTexture.gfxTexture&&t.occlusionTexture.gfxTexture.destroy()));var t;if(e.children)for(const t of e.children)uv(t)}class dv{constructor(e){this._callback=e,this._triggered=!1,"undefined"!=typeof MessageChannel&&(this._channel=new MessageChannel,this._channel.port2.onmessage=()=>{this._triggered=!1,this._callback()})}trigger(){this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout((()=>{this._triggered=!1,this._callback()}),0))}remove(){this._channel=void 0,this._callback=()=>{}}}class pv{constructor(){this.tasks={},this.taskQueue=[],li(["process"],this),this.invoker=new dv(this.process),this.nextId=0}add(e,t){const i=this.nextId++,r=(function({type:e,isSymbolTile:t,zoom:i}){return i=i||0,"message"===e?0:"maybePrepare"!==e||t?"parseTile"!==e||t?"parseTile"===e&&t?300-i:"maybePrepare"===e&&t?400-i:500:200-i:100-i})(t);if(0===r){try{e()}finally{}return null}return this.tasks[i]={fn:e,metadata:t,priority:r,id:i},this.taskQueue.push(i),this.invoker.trigger(),{cancel:()=>{delete this.tasks[i]}}}process(){try{if(this.taskQueue=this.taskQueue.filter((e=>!!this.tasks[e])),!this.taskQueue.length)return;const e=this.pick();if(null===e)return;const t=this.tasks[e];if(delete this.tasks[e],this.taskQueue.length&&this.invoker.trigger(),!t)return;t.fn()}finally{}}pick(){let e=null,t=1/0;for(let i=0;i{i&&delete this.callbacks[s],this.target.postMessage({id:s,type:"",targetMapId:r,sourceMapId:this.mapId})}}}receive(e){const t=e.data,i=t.id;if(i&&(!t.targetMapId||this.mapId===t.targetMapId))if(""===t.type){const e=this.cancelCallbacks[i];delete this.cancelCallbacks[i],e&&e.cancel()}else if(t.mustQueue||yi()){const e=this.callbacks[i],r=this.scheduler.add((()=>this.processTask(i,t)),e&&e.metadata||{type:"message"});r&&(this.cancelCallbacks[i]=r)}else this.processTask(i,t)}processTask(e,t){if(delete this.cancelCallbacks[e],""===t.type){const i=this.callbacks[e];delete this.callbacks[e],i&&(t.error?i(Ma(t.error)):i(null,Ma(t.data)))}else{const i=new Set,r=t.hasCallback?(t,r)=>{this.target.postMessage({id:e,type:"",sourceMapId:this.mapId,error:t?Sa(t):null,data:Sa(r,i)},i)}:e=>{},n=Ma(t.data);if(this.parent[t.type])this.parent[t.type](t.sourceMapId,n,r);else if(this.parent.getWorkerSource){const e=t.type.split(".");this.parent.getWorkerSource(t.sourceMapId,e[0],n.source,n.scope)[e[1]](n,r)}else r(new Error(`Could not find function ${t.type}`))}}remove(){this.scheduler.remove(),this.target.removeEventListener("message",this.receive,!1)}}class mv{constructor(e,t){this.workerPool=e,this.actors=[],this.currentActor=0,this.id=ni();const i=this.workerPool.acquire(this.id);for(let e=0;e{this.ready=!0}))}broadcast(e,t,i){ei(this.actors,((i,r)=>{i.send(e,t,r)}),i=i||function(){})}getActor(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]}remove(){this.actors.forEach((e=>{e.remove()})),this.actors=[],this.workerPool.release(this.id)}}mv.Actor=fv;var _v={workerUrl:"",workerClass:null,workerParams:void 0};function gv(){return null!=_v.workerClass?new _v.workerClass:new self.Worker(_v.workerUrl,_v.workerParams)}const yv="mapboxgl_preloaded_worker_pool";class xv{constructor(){this.active={}}acquire(e){if(!this.workers)for(this.workers=[];this.workers.length{e.terminate()})),this.workers=null)}isPreloaded(){return!!this.active[yv]}numActive(){return Object.keys(this.active).length}}let vv;function bv(){return vv||(vv=new xv),vv}xv.workerCount=2;let wv,Tv,Ev,Sv,Mv,Av=null;function Iv(){return yi()&&self.worker&&self.worker.dracoUrl?self.worker.dracoUrl:Tv||r.DRACO_URL}function Cv(){if(yi()&&self.worker&&self.worker.meshoptUrl)return self.worker.meshoptUrl;if(Sv)return Sv;const e=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]);if("object"!=typeof WebAssembly)throw new Error("WebAssembly not supported, cannot instantiate meshoptimizer");return Sv=WebAssembly.validate(e)?r.MESHOPT_SIMD_URL:r.MESHOPT_URL,Sv}const Pv={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},zv={5120:"DT_INT8",5121:"DT_UINT8",5122:"DT_INT16",5123:"DT_UINT16",5125:"DT_UINT32",5126:"DT_FLOAT32"},Dv={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16};function Rv(e,t,i){const r=i.json.bufferViews.length,n=i.buffers.length;t.bufferView=r,i.json.bufferViews[r]={buffer:n,byteLength:e.byteLength},i.buffers[n]=e}const Lv="KHR_draco_mesh_compression";function kv(e,t){const i=e.extensions&&e.extensions[Lv];if(!i)return;const r=new Ev.Decoder,n=jv(t,i.bufferView),o=new Ev.Mesh;if(!r.DecodeArrayToMesh(n,n.byteLength,o))throw new Error("Failed to decode Draco mesh");const s=t.json.accessors[e.indices],a=Pv[s.componentType],l=s.count*a.BYTES_PER_ELEMENT,c=Ev._malloc(l);a===Uint16Array?r.GetTrianglesUInt16Array(o,l,c):r.GetTrianglesUInt32Array(o,l,c),Rv(Ev.memory.buffer.slice(c,c+l),s,t),Ev._free(c);for(const n of Object.keys(i.attributes)){const s=r.GetAttributeByUniqueId(o,i.attributes[n]),a=t.json.accessors[e.attributes[n]],l=zv[a.componentType],c=a.count*Dv[a.type]*Pv[a.componentType].BYTES_PER_ELEMENT,h=Ev._malloc(c);r.GetAttributeDataArrayForAllPoints(o,s,Ev[l],c,h),Rv(Ev.memory.buffer.slice(h,h+c),a,t),Ev._free(h)}r.destroy(),o.destroy(),delete e.extensions[Lv]}const Ov="EXT_meshopt_compression";function Bv(e,t){if(!e.extensions||!e.extensions[Ov])return;const i=e.extensions[Ov],r=new Uint8Array(t.buffers[i.buffer],i.byteOffset||0,i.byteLength||0),n=new Uint8Array(i.count*i.byteStride);Mv.decodeGltfBuffer(n,i.count,i.byteStride,r,i.mode,i.filter),e.buffer=t.buffers.length,e.byteOffset=0,t.buffers[e.buffer]=n.buffer,delete e.extensions[Ov]}const Fv=1179937895,Nv=new TextDecoder("utf8");function Vv(e,t){return new URL(e,t).href}function Uv(e,t,i,r){return fetch(Vv(e.uri,r)).then((e=>e.arrayBuffer())).then((e=>{t.buffers[i]=e}))}function jv(e,t){const i=e.json.bufferViews[t];return new Uint8Array(e.buffers[i.buffer],i.byteOffset||0,i.byteLength)}function $v(e,t,i,r){if(e.uri){const n=Vv(e.uri,r);return fetch(n).then((e=>e.blob())).then((e=>createImageBitmap(e))).then((e=>{t.images[i]=e}))}if(void 0!==e.bufferView){const r=jv(t,e.bufferView),n=new Blob([r],{type:e.mimeType});return createImageBitmap(n).then((e=>{t.images[i]=e}))}}function Gv(e,t=0,i){const r={json:null,images:[],buffers:[]};if(new Uint32Array(e,t,1)[0]===Fv){const i=new Uint32Array(e,t);let n=2;const o=(i[n++]>>2)-3,s=i[n++]>>2;if(n++,r.json=JSON.parse(Nv.decode(i.subarray(n,n+s))),n+=s,n{const e=[],t=a&&a.includes(Lv),n=a&&a.includes(Ov);if(t&&e.push((function(){if(!Ev)return wv||(wv=(function(e){let t,i=null;function r(){t=new Uint8Array(i.buffer)}function n(){throw new Error("Unexpected Draco error.")}const o={a:{a:n,d:function(e,i,r){return t.copyWithin(e,i,i+r)},c:function(e){const n=t.length,o=Math.max(e>>>0,Math.ceil(1.2*n)),s=Math.ceil((o-n)/65536);try{return i.grow(s),r(),!0}catch(e){return!1}},b:n}};return(WebAssembly.instantiateStreaming?WebAssembly.instantiateStreaming(e,o):e.then((e=>e.arrayBuffer())).then((e=>WebAssembly.instantiate(e,o)))).then((e=>{const{Rb:n,Qb:o,P:s,T:a,X:l,Ja:c,La:h,Qa:u,Va:d,Wa:p,eb:f,jb:m,f:_,e:g,yb:y,zb:x,Ab:v,Bb:b,Db:w,Gb:T}=e.instance.exports;i=g;const E=(()=>{let e=0,i=0,r=0,s=0;return a=>{r&&(n(s),n(e),i+=r,r=e=0),e||(i+=128,e=o(i));const l=a.length+7&-8;let c=e;l>=i&&(r=l,c=s=o(l));for(let e=0;e{Ev=e,wv=void 0})))})()),n&&e.push((function(){if(Mv)return;const e=(function(e){let t;const i=WebAssembly.instantiateStreaming(e,{}).then((e=>{t=e.instance,t.exports.__wasm_call_ctors()})),r={NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},n={ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"};return{ready:i,supported:!0,decodeGltfBuffer(e,i,o,s,a,l){!(function(e,t,i,r,n,o,s){const a=e.exports.sbrk,l=r+3&-4,c=a(l*n),h=a(o.length),u=new Uint8Array(e.exports.memory.buffer);u.set(o,h);const d=t(c,r,n,h,o.length);if(0===d&&s&&s(c,l,n),i.set(u.subarray(c,c+r*n)),a(c-a(0)),0!==d)throw new Error(`Malformed buffer data: ${d}`)})(t,t.exports[n[a]],e,i,o,s,t.exports[r[l]])}}})(fetch(Cv()));return e.ready.then((()=>{Mv=e}))})()),o)for(let t=0;t{if(t&&s)for(const{primitives:e}of s)for(const t of e)kv(t,r);if(n&&s&&l)for(const e of l)Bv(e,r);return r}))}))}function qv(e,t){const i=e.json.bufferViews[t.bufferView],r=Pv[t.componentType];return new r(e.buffers[i.buffer],(t.byteOffset||0)+(i.byteOffset||0),t.count*(i.byteStride&&i.byteStride!==Dv[t.type]*r.BYTES_PER_ELEMENT?i.byteStride/r.BYTES_PER_ELEMENT:Dv[t.type]))}function Zv(e,t,i,r){const n=Pv[t.componentType],o=(function(e){switch(e){case Int8Array:return.007874015748031496;case Uint8Array:return.00392156862745098;case Int16Array:return 3051850947599719e-20;case Uint16Array:return 15259021896696422e-21;default:return 1}})(n),s=e.json.bufferViews[t.bufferView],a=s.byteStride?s.byteStride/n.BYTES_PER_ELEMENT:Dv[t.type],l=i.float32,c=l.length/i.capacity;for(let e=0,i=0;e0){for(let n=0;n0){o.texcoordArray=new oc;const e=t.json.accessors[n.TEXCOORD_0];o.texcoordArray.resize(e.count);const i=qv(t,e);Zv(t,e,o.texcoordArray,i)}if(void 0!==n._FEATURE_ID_RGBA4444){const e=t.json.accessors[n._FEATURE_ID_RGBA4444];t.json.extensionsUsed&&t.json.extensionsUsed.includes("EXT_meshopt_compression")&&(o.featureData=qv(t,e))}void 0!==n._FEATURE_RGBA4444&&(o.featureData=new Uint32Array(qv(t,t.json.accessors[n._FEATURE_RGBA4444]).buffer));const u=e.material;return o.material=(function(e,t){const{emissiveFactor:i=[0,0,0],alphaMode:r="OPAQUE",alphaCutoff:n=.5,normalTexture:o,occlusionTexture:s,emissiveTexture:a,doubleSided:l}=e,{baseColorFactor:c=[1,1,1,1],metallicFactor:h=1,roughnessFactor:u=1,baseColorTexture:d,metallicRoughnessTexture:p}=e.pbrMetallicRoughness||{},f=s?t[s.index]:void 0;if(s&&s.extensions&&s.extensions.KHR_texture_transform&&f){const e=s.extensions.KHR_texture_transform;f.offsetScale=[e.offset[0],e.offset[1],e.scale[0],e.scale[1]]}return{pbrMetallicRoughness:{baseColorFactor:new $r(...c),metallicFactor:h,roughnessFactor:u,baseColorTexture:d?t[d.index]:void 0,metallicRoughnessTexture:p?t[p.index]:void 0},doubleSided:l,emissiveFactor:i,alphaMode:r,alphaCutoff:n,normalTexture:o?t[o.index]:void 0,occlusionTexture:f,emissionTexture:a?t[a.index]:void 0,defined:void 0===e.defined}})(void 0!==u?t.json.materials[u]:{defined:!1},i),o}function Hv(t,i,r){const{matrix:n,rotation:o,translation:s,scale:a,mesh:l,extras:c,children:h}=t,u={};if(u.matrix=n||e.ae.fromRotationTranslationScale([],o||[0,0,0,1],s||[0,0,0],a||[1,1,1]),void 0!==l){u.meshes=r[l];const e=u.anchor=[0,0];for(const t of u.meshes){const{min:i,max:r}=t.aabb;e[0]+=i[0]+r[0],e[1]+=i[1]+r[1]}e[0]=Math.floor(e[0]/u.meshes.length/2),e[1]=Math.floor(e[1]/u.meshes.length/2)}if(c&&(c.id&&(u.id=c.id),c.lights&&(u.lights=(function(e){if(!e.length)return[];const t=(function(e){const t=atob(e),i=new Uint8Array(t.length);for(let e=0;e1&&r[r.length-1].equals(r[0])&&r.pop();let n=0;for(let e=0;e0&&r.reverse();const o=Td(r.flatMap((e=>[e.x,e.y])),[]);return 0===o.length?null:{vertices:r,indices:o}}function Jv(t,i){const r=[],n=[];let o=0;const s=[];for(const a of t){o=r.length;const t=a.vertexArray.float32,l=a.indexArray.uint16;for(let n=0;n0&&([n[e+1],n[e+2]]=[n[e+2],n[e+1]])}return{vertices:r,indices:n}}function Kv(e){const t=(function(e,t){const i=[],r=WebGL2RenderingContext;if(e.json.textures)for(const n of e.json.textures){const o={magFilter:r.LINEAR,minFilter:r.NEAREST,wrapS:r.REPEAT,wrapT:r.REPEAT};void 0!==n.sampler&&Object.assign(o,e.json.samplers[n.sampler]),i.push({image:t[n.source],sampler:o,uploaded:!1})}return i})(e,e.images),i=(function(e,t){const i=[];for(const r of e.json.meshes){const n=[];for(const i of r.primitives)n.push(Wv(i,e,t));i.push(n)}return i})(e,t),{scenes:r,scene:n,nodes:o}=e.json,s=r?r[n||0].nodes:o,a=[];for(const t of s)a.push(Hv(o[t],e,i));return(function(e,t,i){const r={},n=new Set;for(let o=0;o0){const t=Array.from(n.values()).sort(((e,t)=>e-t));for(let i=t.length-1;i>=0;i--)e.splice(t[i],1)}})(a,s,e.json.nodes),a}function Qv(e){e.heightmap=new Float32Array(4096),e.heightmap.fill(-1);const t=e.vertexArray.float32,i=e.aabb.min[0]-1,r=e.aabb.min[1]-1,n=nv/(e.aabb.max[0]-i+2),o=nv/(e.aabb.max[1]-r+2);for(let s=0;se.heightmap[c*nv+l]&&(e.heightmap[c*nv+l]=a)}}function eb(t,i){const r={};r.indexArray=new Jl,r.indexArray.reserve(4*t.length),r.vertexArray=new Nl,r.vertexArray.reserve(10*t.length),r.colorArray=new Fl,r.vertexArray.reserve(10*t.length);let n=0;for(const o of t){const t=Math.min(10,Math.max(4,1.3*o.height))*i,s=[-o.normal[1],o.normal[0],0],a=Math.min(.29,.1*o.width/o.depth),l=o.width-2*o.depth*i*(a+.01),c=e.$.scaleAndAdd([],o.pos,s,l/2),h=e.$.scaleAndAdd([],o.pos,s,-l/2),u=[c[0],c[1],c[2]+o.height],d=[h[0],h[1],h[2]+o.height],p=e.$.scaleAndAdd([],o.normal,s,a);e.$.scale(p,p,t);const f=e.$.scaleAndAdd([],o.normal,s,-a);e.$.scale(f,f,t),e.$.add(p,c,p),e.$.add(f,h,f),c[2]+=.1,h[2]+=.1,r.vertexArray.emplaceBack(p[0],p[1],p[2]),r.vertexArray.emplaceBack(f[0],f[1],f[2]),r.vertexArray.emplaceBack(c[0],c[1],c[2]),r.vertexArray.emplaceBack(h[0],h[1],h[2]),r.vertexArray.emplaceBack(u[0],u[1],u[2]),r.vertexArray.emplaceBack(d[0],d[1],d[2]),r.vertexArray.emplaceBack(c[0],c[1],c[2]),r.vertexArray.emplaceBack(h[0],h[1],h[2]),r.vertexArray.emplaceBack(p[0],p[1],p[2]),r.vertexArray.emplaceBack(f[0],f[1],f[2]);const m=l/t/2;r.colorArray.emplaceBack(-m-a,-1,m,.8),r.colorArray.emplaceBack(m+a,-1,m,.8),r.colorArray.emplaceBack(-m,0,m,1.3),r.colorArray.emplaceBack(m,0,m,1.3),r.colorArray.emplaceBack(m+a,-.8,m,.7),r.colorArray.emplaceBack(m+a,-.8,m,.7),r.colorArray.emplaceBack(0,0,m,1.3),r.colorArray.emplaceBack(0,0,m,1.3),r.colorArray.emplaceBack(m+a,-1.2,m,.8),r.colorArray.emplaceBack(m+a,-1.2,m,.8),r.indexArray.emplaceBack(6+n,4+n,8+n),r.indexArray.emplaceBack(7+n,9+n,5+n),r.indexArray.emplaceBack(0+n,1+n,2+n),r.indexArray.emplaceBack(1+n,3+n,2+n),n+=10}const o={defined:!0,emissiveFactor:[0,0,0]},s={};return s.baseColorFactor=$r.white,o.pbrMetallicRoughness=s,r.material=o,r.aabb=new Su([1/0,1/0,1/0],[-1/0,-1/0,-1/0]),r}const tb=new Float32Array(262144),ib=new Uint8Array(262144);function rb(e){let t=0;if(e.meshes)for(const i of e.meshes)t=Math.max(t,i.aabb.max[2]);if(e.children)for(const i of e.children)t=Math.max(t,rb(i));return t}function nb(e,t,i){if(e.meshes)for(const r of e.meshes)r.aabb.min[0]!==1/0&&i.insert(t,r.aabb.min[0],r.aabb.min[1],r.aabb.max[0],r.aabb.max[1]);if(e.children)for(const r of e.children)nb(r,t,i)}const ob=["","wall","door","roof","window","lamp","logo"];class sb{constructor(e){this.node=e,this.evaluatedRMEA=[[1,0,0,1],[1,0,0,1],[1,0,0,1],[1,0,0,1],[.4,1,0,1],[1,0,0,1],[1,0,0,1]],this.hiddenByReplacement=!1,this.evaluatedScale=[1,1,1],this.evaluatedColor=[],this.emissionHeightBasedParams=[],this.feature={type:"Point",id:e.id,geometry:[],properties:{height:rb(e)}},this.aabb=this._getLocalBounds()}_getLocalBounds(){if(!this.node.meshes)return new Su([1/0,1/0,1/0],[-1/0,-1/0,-1/0]);if(!this.aabb){let e=0;const t=new Su([1/0,1/0,1/0],[-1/0,-1/0,-1/0]);for(const i of this.node.meshes)this.node.lightMeshIndex!==e&&(i.transformedAabb=Su.applyTransformFast(i.aabb,this.node.matrix),t.encapsulate(i.transformedAabb)),e++;this.aabb=t}return this.aabb}}class ab{constructor(e,t,i,r,n,o){this.id=t,this.modelTraits|=ov.CoordinateSpaceTile,this.uploaded=!1,this.hasPattern=!1,i&&(this.modelTraits|=ov.HasMapboxMeshFeatures),r&&(this.modelTraits|=ov.HasMeshoptCompression),this.zoom=-1,this.terrainExaggeration=1,this.projection={name:"mercator"},this.replacementUpdateTime=0,this.elevationReadFromZ=255,this.brightness=n,this.dirty=!0,this.needsUpload=!1,this.nodesInfo=[];for(const t of e)this.nodesInfo.push(new sb(t)),nb(t,o.featureIndexArray.length,o.grid),o.featureIndexArray.emplaceBack(this.nodesInfo.length-1,0,o.bucketLayerIDs.length-1,0)}updateFootprints(e,t){for(const i of this.getNodesInfo()){const r=i.node;r.footprint&&t.push({footprint:r.footprint,id:e})}}update(){console.log("Update 3D model bucket")}populate(){console.log("populate 3D model bucket")}uploadPending(){return!this.uploaded||this.needsUpload}upload(e){if(!this.needsUpload)return;const t=this.getNodesInfo();for(const i of t){const t=i.node;this.uploaded?this.updatePbrBuffer(t):cv(t,e,!0)}for(const e of t)hv(e.node);this.uploaded=!0,this.needsUpload=!1}updatePbrBuffer(e){let t=!1;if(!e.meshes)return t;for(const i of e.meshes)i.pbrBuffer&&(i.pbrBuffer.updateData(i.featureArray),t=!0);return t}needsReEvaluation(e,t,i){const r=e.transform.projectionOptions,n=e.style.getBrightness(),o=this.brightness!==n;return!!(!this.uploaded||this.dirty||r.name!==this.projection.name||lb(i.paint.get("model-color").value,o)||lb(i.paint.get("model-color-mix-intensity").value,o)||lb(i.paint.get("model-roughness").value,o)||lb(i.paint.get("model-emissive-strength").value,o)||lb(i.paint.get("model-height-based-emissive-strength-multiplier").value,o))&&(this.projection=r,this.brightness=n,!0)}evaluateScale(e,t){if(e.transform.zoom===this.zoom)return;this.zoom=e.transform.zoom;const i=this.getNodesInfo(),r=this.id.canonical;for(const e of i){const i=e.feature;e.evaluatedScale=t.paint.get("model-scale").evaluate(i,{},r)}}evaluate(e){const t=this.getNodesInfo();for(const i of t){if(!i.node.meshes)continue;const t=i.feature,r=i.node.meshes&&i.node.meshes[0].featureData,n=i.evaluatedColor[2],o=i.evaluatedRMEA[2],s=this.id.canonical;if(i.hasTranslucentParts=!1,r){for(let r=0;r=e)continue;const u=tb[c],d=Math.abs(u);d>a&&(s=u,a=d,l=n,h=t)}if(a>.1){const o=1-(e+.5*Math.abs(l*h))/c;let a=t._dem.get(r,i)+s*o;const u=t._dem.get(r+l,i+h),d=t._dem.get(r-l,i-h,!0);(a-u)*(a-d)>0&&(a=(u+d)/2),tb[n]=t._dem.set(r,i,a),ib[n]=e}}}}}s&&(t._demTile.needsDEMTextureUpload=!0,t._dem._timestamp=Li.now())}getNodesInfo(){return this.nodesInfo}destroy(){const e=this.getNodesInfo();for(const t of e)hv(t.node),uv(t.node)}isEmpty(){return!this.nodesInfo.length}updateReplacement(e,t){if(t.updateTime===this.replacementUpdateTime)return;this.replacementUpdateTime=t.updateTime;const i=t.getReplacementRegionsForTile(e.toUnwrapped()),r=this.getNodesInfo();for(let e=0;ee.footprint===t.footprint))}}getHeightAtTileCoord(t,i){const r=this.getNodesInfo(),n=[],o=[0,0,0],s=e.ae.identity([]);for(let a=0;ah.max[0]||i>h.max[1])continue;if(!0===l.node.hidden)return{height:0,maxHeight:l.feature.properties.height,hidden:!1,verticalScale:l.evaluatedScale[2]};e.ae.invert(s,l.node.matrix),o[0]=t,o[1]=i,e.$.transformMat4(o,o,s);const u=(o[0]-c.aabb.min[0])/(c.aabb.max[0]-c.aabb.min[0])*nv|0,d=Math.min(63,(o[1]-c.aabb.min[1])/(c.aabb.max[1]-c.aabb.min[1])*nv|0)*nv+Math.min(63,u),p=c.heightmap[d];if(!(p<0&&l.node.footprint)){if(l.hiddenByReplacement)return;return{height:p,maxHeight:l.feature.properties.height,hidden:!1,verticalScale:l.evaluatedScale[2]}}if(l.node.footprint.grid.query(new Ut(t,i),new Ut(t,i),n),n.length>0)return{height:void 0,maxHeight:l.feature.properties.height,hidden:l.hiddenByReplacement,verticalScale:l.evaluatedScale[2]}}}}function lb(e,t){return!e.isLightConstant&&t}function cb(e,t,i,r,n,o,s,a){let l=(61440&t|(61440&t)>>4)>>8,c=(3840&t|(3840&t)>>4)>>4,h=240&t|(240&t)>>4;i[3]>0&&(l=qr(l,255*i[0],i[3]),c=qr(c,255*i[1],i[3]),h=qr(h,255*i[2],i[3]));const u=l<<8|c,d=h<<8|Math.floor(255*r[3]),p=(function(e){const t=Jt(e,0,2);return Math.min(Math.round(.5*t*255),255)})(r[2])<<8|15*r[0]<<4|15*r[1],f=Jt(n[0],0,1),m=Jt(n[1],0,1),_=Jt(n[2],0,1),g=Jt(n[3],0,1);let y,x,v,b;if(f!==m&&s!==o&&m!==f){const e=s-o;x=1/(e*(m-f)),v=-(o+e*f)/(e*(m-f));const t=Jt(n[4],-1,1);b=Math.pow(10,t),y=255*_<<8|255*g}else y=65535,x=0,v=1,b=1;if(e.emplaceBack(u,d,p,y,x,v,b),a){const e=a.length;a.clear();for(let t=0;t>16&65535,a=o?t>>16&65535:65535&t,l=(15&a)<8?15&a:0,c=e.evaluatedRMEA[l],h=e.evaluatedColor[l],u=e.emissionHeightBasedParams[l];let d;if(s&&2===l&&r.lights&&(d=new ac,d.resize(10*r.lights.length)),cb(i.featureArray,n,h,c,u,i.aabb.min[2],i.aabb.max[2],d),d&&s){s=!1;const e=r.meshes[r.lightMeshIndex];e.featureArray=d,e.featureArray._trim()}}i.featureArray._trim(),n++}}function ub(e,t,i,r){const n=1<e.polygon)).flat());const g=f?l:null,[y,x]=(function(t,i,r,n,o,s,a,l,c,h,u){return"globe"===t.projection.name?(function(t,i,r,n,o,s,a,l,c,h,u){const d=[],p=[],f=t.projection.upVectorScale(u,t.center.lat,t.worldSize).metersToTile,m=[0,0,0,1],_=[0,0,0,1],g=(e,t,i,r)=>{e[0]=t,e[1]=i,e[2]=r,e[3]=1},y=zf();r>0&&(r+=y),n+=y;for(const y of i){const i=[],x=[];for(const d of y){const p=d.x+o.x,y=d.y+o.y,v=t.projection.projectTilePoint(p,y,u),b=t.projection.upVector(u,d.x,d.y);let w=r,T=n;if(a){const e=Ff(p,y,r,n,a,l,c,h);w+=e.base,T+=e.top}0!==r?g(m,v.x+b[0]*f*w,v.y+b[1]*f*w,v.z+b[2]*f*w):g(m,v.x,v.y,v.z),g(_,v.x+b[0]*f*T,v.y+b[1]*f*T,v.z+b[2]*f*T),e.$.transformMat4(m,m,s),e.$.transformMat4(_,_,s),i.push(new Ap(m[0],m[1],m[2])),x.push(new Ap(_[0],_[1],_[2]))}d.push(i),p.push(x)}return[d,p]})(t,i,r,n,o,s,a,l,c,h,u):a?(function(t,i,r,n,o,s,a,l,c){const h=[],u=[],d=[0,0,0,1];for(const p of t){const t=[],f=[];for(const h of p){const u=h.x+n.x,p=h.y+n.y,m=Ff(u,p,i,r,s,a,l,c);d[0]=u,d[1]=p,d[2]=m.base,d[3]=1,e.aB.transformMat4(d,d,o),d[3]=Math.max(d[3],1e-5);const _=new Ap(d[0]/d[3],d[1]/d[3],d[2]/d[3]);d[0]=u,d[1]=p,d[2]=m.top,d[3]=1,e.aB.transformMat4(d,d,o),d[3]=Math.max(d[3],1e-5);const g=new Ap(d[0]/d[3],d[1]/d[3],d[2]/d[3]);t.push(_),f.push(g)}h.push(t),u.push(f)}return[h,u]})(i,r,n,o,s,a,l,c,h):(function(e,t,i,r,n){const o=[],s=[],a=n[8]*t,l=n[9]*t,c=n[10]*t,h=n[11]*t,u=n[8]*i,d=n[9]*i,p=n[10]*i,f=n[11]*i;for(const t of e){const e=[],i=[];for(const o of t){const t=o.x+r.x,s=o.y+r.y,m=n[0]*t+n[4]*s+n[12],_=n[1]*t+n[5]*s+n[13],g=n[2]*t+n[6]*s+n[14],y=n[3]*t+n[7]*s+n[15],x=m+a,v=_+l,b=g+c,w=Math.max(y+h,1e-5),T=m+u,E=_+d,S=g+p,M=Math.max(y+f,1e-5);e.push(new Ap(x/w,v/w,b/w)),i.push(new Ap(T/M,E/M,S/M))}o.push(e),s.push(i)}return[o,s]})(i,r,n,o,s)})(s,n,d,u,h,a,g,p,m,s.center.lat,t.tileID.canonical),v=t.queryGeometry;return(function(e,t,i){let r=1/0;eu(i,t)&&(r=Bf(i,t[0]));for(let n=0;n{if(lx)return lx;const e=sx();return lx=new ax(e.paint.properties["line-width"].specification),lx.useIntegerZoom=!0,lx})().possiblyEvaluate(this._transitioningPaint._values["line-width"].value,e)}createBucket(e){return new nm(e)}getProgramIds(){return[this.paint.get("line-pattern").constantOr(1)?"linePattern":"line"]}getDefaultProgramParams(e,t,i){const r=um(this);return{config:new Jc(this,{zoom:t,lut:i}),defines:r,overrideFog:!1}}queryRadius(e){const t=e,i=dx(du("line-width",this,t),du("line-gap-width",this,t)),r=du("line-offset",this,t);return i/2+Math.abs(r)+pu(this.paint.get("line-translate"))}queryIntersectsFeature(e,t,i,r,n,o){if(e.queryGeometry.isAboveHorizon)return!1;const s=fu(e.tilespaceGeometry,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),o.angle,e.pixelToTileUnitsFactor),a=e.pixelToTileUnitsFactor/2*dx(this.paint.get("line-width").evaluate(t,i),this.paint.get("line-gap-width").evaluate(t,i)),l=this.paint.get("line-offset").evaluate(t,i);return l&&(r=(function(e,t){const i=[],r=new Ut(0,0);for(let n=0;n=3)for(let t=0;t>4;if(1!==r)throw new Error(`Got v${r} data when expected v1.`);const n=pb[15&i];if(!n)throw new Error("Unrecognized array type.");const[o]=new Uint16Array(e,2,1),[s]=new Uint32Array(e,4,1);return new fb(s,o,n,e)}constructor(e,t=64,i=Float64Array,r){if(isNaN(e)||e<0)throw new Error(`Unpexpected numItems value: ${e}.`);this.numItems=+e,this.nodeSize=Math.min(Math.max(+t,2),65535),this.ArrayType=i,this.IndexArrayType=e<65536?Uint16Array:Uint32Array;const n=pb.indexOf(this.ArrayType),o=2*e*this.ArrayType.BYTES_PER_ELEMENT,s=e*this.IndexArrayType.BYTES_PER_ELEMENT,a=(8-s%8)%8;if(n<0)throw new Error(`Unexpected typed array class: ${i}.`);r&&r instanceof ArrayBuffer?(this.data=r,this.ids=new this.IndexArrayType(this.data,8,e),this.coords=new this.ArrayType(this.data,8+s+a,2*e),this._pos=2*e,this._finished=!0):(this.data=new ArrayBuffer(8+o+s+a),this.ids=new this.IndexArrayType(this.data,8,e),this.coords=new this.ArrayType(this.data,8+s+a,2*e),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+n]),new Uint16Array(this.data,2,1)[0]=t,new Uint32Array(this.data,4,1)[0]=e)}add(e,t){const i=this._pos>>1;return this.ids[i]=i,this.coords[this._pos++]=e,this.coords[this._pos++]=t,i}finish(){const e=this._pos>>1;if(e!==this.numItems)throw new Error(`Added ${e} items when expected ${this.numItems}.`);return mb(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(e,t,i,r){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:n,coords:o,nodeSize:s}=this,a=[0,n.length-1,0],l=[];for(;a.length;){const c=a.pop()||0,h=a.pop()||0,u=a.pop()||0;if(h-u<=s){for(let s=u;s<=h;s++){const a=o[2*s],c=o[2*s+1];a>=e&&a<=i&&c>=t&&c<=r&&l.push(n[s])}continue}const d=u+h>>1,p=o[2*d],f=o[2*d+1];p>=e&&p<=i&&f>=t&&f<=r&&l.push(n[d]),(0===c?e<=p:t<=f)&&(a.push(u),a.push(d-1),a.push(1-c)),(0===c?i>=p:r>=f)&&(a.push(d+1),a.push(h),a.push(1-c))}return l}within(e,t,i){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:r,coords:n,nodeSize:o}=this,s=[0,r.length-1,0],a=[],l=i*i;for(;s.length;){const c=s.pop()||0,h=s.pop()||0,u=s.pop()||0;if(h-u<=o){for(let i=u;i<=h;i++)xb(n[2*i],n[2*i+1],e,t)<=l&&a.push(r[i]);continue}const d=u+h>>1,p=n[2*d],f=n[2*d+1];xb(p,f,e,t)<=l&&a.push(r[d]),(0===c?e-i<=p:t-i<=f)&&(s.push(u),s.push(d-1),s.push(1-c)),(0===c?e+i>=p:t+i>=f)&&(s.push(d+1),s.push(h),s.push(1-c))}return a}}function mb(e,t,i,r,n,o){if(n-r<=i)return;const s=r+n>>1;_b(e,t,s,r,n,o),mb(e,t,i,r,s-1,1-o),mb(e,t,i,s+1,n,1-o)}function _b(e,t,i,r,n,o){for(;n>r;){if(n-r>600){const s=n-r+1,a=i-r+1,l=Math.log(s),c=.5*Math.exp(2*l/3),h=.5*Math.sqrt(l*c*(s-c)/s)*(a-s/2<0?-1:1);_b(e,t,i,Math.max(r,Math.floor(i-a*c/s+h)),Math.min(n,Math.floor(i+(s-a)*c/s+h)),o)}const s=t[2*i+o];let a=r,l=n;for(gb(e,t,r,i),t[2*n+o]>s&&gb(e,t,r,n);as;)l--}t[2*r+o]===s?gb(e,t,r,l):(l++,gb(e,t,l,n)),l<=i&&(r=l+1),i<=l&&(n=l-1)}}function gb(e,t,i,r){yb(e,i,r),yb(t,2*i,2*r),yb(t,2*i+1,2*r+1)}function yb(e,t,i){const r=e[t];e[t]=e[i],e[i]=r}function xb(e,t,i,r){const n=e-i,o=t-r;return n*n+o*o}e.A=Wo,e.B=Xo,e.C=$r,e.D=Zo,e.E=Br,e.F=Rn,e.H=hl,e.I=Hg,e.J=ta,e.K=Ks,e.L=function(e){const t=e.value;let i=[];if(!t)return i;const r=In(t);return"string"!==r?(i=i.concat([new Jx(e.key,t,`string expected, "${r}" found`)]),i):(Kx(t,!0)||(i=i.concat([new Jx(e.key,t,`invalid url "${t}"`)])),i)},e.M=class{constructor(e,t,i,r){this.id=e,this.position=null!=t?new _h(t[0],t[1]):new _h(0,0),this.orientation=null!=i?i:[0,0,0],this.nodes=r,this.uploaded=!1,this.aabb=new Su([1/0,1/0,1/0],[-1/0,-1/0,-1/0]),this.matrix=[]}_applyTransformations(t,i){if(e.ae.multiply(t.matrix,i,t.matrix),t.meshes)for(const e of t.meshes){const i=Su.applyTransformFast(e.aabb,t.matrix);this.aabb.encapsulate(i)}if(t.children)for(const e of t.children)this._applyTransformations(e,t.matrix)}computeBoundsAndApplyParent(){const t=e.ae.identity([]);for(const e of this.nodes)this._applyTransformations(e,t)}computeModelMatrix(e,t,i,r,n,o,s=!1){sv(this.matrix,this,e.transform,this.position,t,i,r,n,o,s)}upload(e){if(!this.uploaded){for(const t of this.nodes)cv(t,e);for(const e of this.nodes)hv(e);this.uploaded=!0}}destroy(){for(const e of this.nodes)uv(e)}},e.N=al,e.O=Ja,e.P=Ut,e.Q=ii,e.R=Qi,e.S=lc,e.T=Fg,e.U=sl,e.V=Jx,e.W=rl,e.X=class{constructor(e){this.specification=e}possiblyEvaluate(e,t){return gi(e.expression.evaluate(t))}interpolate(e,t,i){return{x:qr(e.x,t.x,i),y:qr(e.y,t.y,i),z:qr(e.z,t.z,i),azimuthal:qr(e.azimuthal,t.azimuthal,i),polar:qr(e.polar,t.polar,i)}}},e.Y=Ha,e.Z=pa,e._=Nh,e.a=Qg,e.a$=xu,e.a0=Kt,e.a1=il,e.a2=Yu,e.a3=qr,e.a4=uo,e.a5=Zr,e.a6=class{constructor(e){this.specification=e}possiblyEvaluate(e,t){return(function([e,t]){const i=gi([1,e,t]);return{x:i.x,y:i.y,z:i.z}})(e.expression.evaluate(t))}interpolate(e,t,i){return{x:qr(e.x,t.x,i),y:qr(e.y,t.y,i),z:qr(e.z,t.z,i)}}},e.a7=Uc,e.a8=Lc,e.a9=Oc,e.aA=function(e,t,i){e[4*t+0]=i[0],e[4*t+1]=i[1],e[4*t+2]=i[2],e[4*t+3]=i[3]},e.aC=function(t,i){const{x:r,y:n}=t.point,o=Xu(r,n,t.worldSize/t._pixelsPerMercatorPixel,0,0);return e.ae.multiply(o,o,Zu(ku(i)))},e.aE=Wm,e.aF=i_,e.aG=Zm,e.aH=function(e,t,i,r,n){const o=5*t+2;e.float32[o+0]=i,e.float32[o+1]=r,e.float32[o+2]=n},e.aI=Rg,e.aJ=_h,e.aK=Ag,e.aL=bh,e.aM=Eu,e.aN=kx,e.aO=vh,e.aP=Nu,e.aQ=wh,e.aR=function(e,t,i,r,n,o,s,a,l){if("globe"===l.name)return Nu(e,t,new vh(i,r,n),!1);const c=og({z:i,x:r,y:n},l);return new Su([(o+c.x/c.scale)*t,t*(c.y/c.scale),s],[(o+c.x2/c.scale)*t,t*(c.y2/c.scale),a])},e.aS=function(e,t,i){let r=0;for(let i=0;i<2;++i){const n=0;e[i]>n&&(r+=(e[i]-n)*(e[i]-n)),t[i]0&&r[0]<=t.width&&r[1]>0&&r[1]<=t.height&&!Ku(t,new _h(t.center.lat,90)),n[0]>0&&n[0]<=t.width&&n[1]>0&&n[1]<=t.height&&!Ku(t,new _h(t.center.lat,-90))]},e.aX=function(t,i){const{scale:r}=t.tileTransform,n=r*uo/(t.tileSize*Math.pow(2,i.zoom-t.tileID.overscaledZ+t.tileID.canonical.z));return e.aD.scale(new Float32Array(4),i.inverseAdjustmentMatrix,[n,n])},e.aY=Ox,e.aZ=Lx,e.a_=function(t){const i=Lx(t,!0);return e.aD.invert([],[i[0],i[1],i[4],i[5]])},e.aa=Nc,e.ab=kc,e.ac=qt,e.ad=function(e,t,i){const r=Math.sqrt(e*e+t*t+i*i),n=r>0?Math.acos(i/r)*Gt:0;let o=0!==e||0!==t?Math.atan2(-t,-e)*Gt+90:0;return o<0&&(o+=360),[r,o,n]},e.af=Xg,e.ag=iy,e.ah=Jg,e.ai=function(e,t){const i={};for(let r=0;rNi&&(e.getActor().send("enforceCacheSizeLimit",Fi),qi=0)},e.ao=yr,e.ap=class{constructor(e){this.entries={},this.scheduler=e}request(e,t,i,r){const n=this.entries[e]=this.entries[e]||{callbacks:[]};if(n.result){const[e,i]=n.result;return this.scheduler?this.scheduler.add((()=>{r(e,i)}),t):r(e,i),()=>{}}return n.callbacks.push(r),n.cancel||(n.cancel=i(((i,r)=>{n.result=[i,r];for(const e of n.callbacks)this.scheduler?this.scheduler.add((()=>{e(i,r)}),t):e(i,r);setTimeout((()=>delete this.entries[e]),3e3)}))),()=>{n.result||(n.callbacks=n.callbacks.filter((e=>e!==r)),n.callbacks.length||(n.cancel(),delete this.entries[e]))}}},e.aq=function(e,t,i){const r=JSON.stringify(e.request);return e.data&&(this.deduped.entries[r]={result:[null,e.data]}),this.deduped.request(r,{type:"parseTile",isSymbolTile:e.isSymbolTile,zoom:e.tileZoom},(t=>{const r=rr(e.request,((e,r,n,o)=>{e?t(e):r&&t(null,{vectorTile:i?void 0:new Sp(new Om(r)),rawData:r,cacheControl:n,expires:o})}));return()=>{r.cancel(),t()}}),t)},e.ar=Bc,e.as=class extends Rc{constructor(e){super(e),this.current=jc}set(e,t,i){if(this.fetchUniformLocation(e,t))for(let e=0;e<9;e++)if(i[e]!==this.current[e]){this.current=i,this.gl.uniformMatrix3fv(this.location,!1,i);break}}},e.at=Fc,e.au=Jt,e.av=Qt,e.ax=Ii,e.ay=Ph,e.az=Dh,e.b=Sc,e.b$=Eh,e.b0=function(e){const{x:t,y:i}=e.point,{lng:r,lat:n}=e._center;return Xu(t,i,e.worldSize,r,n)},e.b1=Zt,e.b2=Th,e.b3=oh,e.b4=function(e){const t=Math.round((e+45+360)%360/90)%4;return Wt[t]},e.b5=45,e.b6=Ah,e.b7=Fh,e.b8=Su,e.b9=gi,e.bA=oy,e.bB=md,e.bC=function(e,t){return[Math.pow(e[0],2.2)*t,Math.pow(e[1],2.2)*t,Math.pow(e[2],2.2)*t]},e.bD=lm,e.bF=Hu,e.bG=Di,e.bH=zi,e.bI=256,e.bJ=function(t,i){const r=[0,0,0],n=qu(ku(i.canonical));return e.$.transformMat4(r,r,n),e.$.transformMat4(r,r,t),r},e.bK=e=>({u_camera_to_center_distance:new kc(e),u_extrude_scale:new Gc(e),u_device_pixel_ratio:new kc(e),u_matrix:new Uc(e),u_inv_rot_matrix:new Uc(e),u_merc_center:new Oc(e),u_tile_id:new Bc(e),u_zoom_transition:new kc(e),u_up_dir:new Bc(e),u_emissive_strength:new kc(e)}),e.bL=e=>({u_matrix:new Uc(e),u_pixels_to_tile_units:new Gc(e),u_device_pixel_ratio:new kc(e),u_units_to_pixels:new Oc(e),u_dash_image:new Lc(e),u_gradient_image:new Lc(e),u_image_height:new kc(e),u_texsize:new Oc(e),u_tile_units_to_pixels:new kc(e),u_alpha_discard_threshold:new kc(e),u_trim_offset:new Oc(e),u_trim_fade_range:new Oc(e),u_trim_color:new Fc(e),u_emissive_strength:new kc(e)}),e.bM=e=>({u_matrix:new Uc(e),u_texsize:new Oc(e),u_pixels_to_tile_units:new Gc(e),u_device_pixel_ratio:new kc(e),u_image:new Lc(e),u_units_to_pixels:new Oc(e),u_tile_units_to_pixels:new kc(e),u_alpha_discard_threshold:new kc(e),u_trim_offset:new Oc(e)}),e.bN=Xl,e.bO=Qf,e.bP=$m,e.bQ=Hm,e.bR=H_,e.bS=p_,e.bT=rd,e.bU=(e,t,i,r,n,o)=>{const s=e.transform,a="globe"===s.projection.name;let l;if("map"===o.paint.get("circle-pitch-alignment"))if(a){const e=Hu(s.zoom,t.canonical)*s._pixelsPerMercatorPixel;l=Float32Array.from([e,0,0,e])}else l=s.calculatePixelsToTileUnitsMatrix(i);else l=new Float32Array([s.pixelsToGLUnits[0],0,0,s.pixelsToGLUnits[1]]);const c={u_camera_to_center_distance:e.transform.getCameraToCenterDistance(s.projection),u_matrix:e.translatePosMatrix(t.projMatrix,i,o.paint.get("circle-translate"),o.paint.get("circle-translate-anchor")),u_device_pixel_ratio:Li.devicePixelRatio,u_extrude_scale:l,u_inv_rot_matrix:id,u_merc_center:[0,0],u_tile_id:[0,0,0],u_zoom_transition:0,u_up_dir:[0,0,0],u_emissive_strength:o.paint.get("circle-emissive-strength")};if(a){c.u_inv_rot_matrix=r,c.u_merc_center=n,c.u_tile_id=[t.canonical.x,t.canonical.y,1<{const s=e.transform;return{u_matrix:hm(e,t,i,r),u_texsize:t.imageAtlasTexture?t.imageAtlasTexture.size:[0,0],u_pixels_to_tile_units:s.calculatePixelsToTileUnitsMatrix(t),u_device_pixel_ratio:n,u_image:0,u_tile_units_to_pixels:cm(t,s),u_units_to_pixels:[1/s.pixelsToGLUnits[0],1/s.pixelsToGLUnits[1]],u_alpha_discard_threshold:0,u_trim_offset:o}},e.bX=(e,t,i,r,n,o,s)=>{const a=e.transform,l=a.calculatePixelsToTileUnitsMatrix(t);return{u_matrix:hm(e,t,i,r),u_pixels_to_tile_units:l,u_device_pixel_ratio:o,u_units_to_pixels:[1/a.pixelsToGLUnits[0],1/a.pixelsToGLUnits[1]],u_dash_image:0,u_gradient_image:1,u_image_height:n,u_texsize:dm(i)&&t.lineAtlasTexture?t.lineAtlasTexture.size:[0,0],u_tile_units_to_pixels:cm(t,e.transform),u_alpha_discard_threshold:0,u_trim_offset:s,u_trim_fade_range:i.paint.get("line-trim-fade-range"),u_trim_color:i.paint.get("line-trim-color").toRenderColor(i.lut).toArray01(),u_emissive_strength:i.paint.get("line-emissive-strength")}},e.bY=si,e.bZ=vd,e.b_=zf,e.ba=function(e){return[Math.pow(e[0],.45454545454545453),Math.pow(e[1],.45454545454545453),Math.pow(e[2],.45454545454545453)]},e.bb=Ht,e.bc=function(e,t,i){const r=Yu(i.zoom),n=e.style.map._antialias,o=t.options.extStandardDerivativesForceOff||e.terrain&&e.terrain.exaggeration()>0;return 0===r&&!n&&!o},e.bd=function(t){const i=t.pixelsPerMeter,r=i/Ph(1,t.center.lat),n=e.ae.identity(new Float64Array(16));return e.ae.translate(n,n,[t.point.x,t.point.y,0]),e.ae.scale(n,n,[r,r,i]),Float32Array.from(n)},e.be=Vu,e.bf=function(e){const t=80.051129;e=Jt(e,-80.051129,t)/t*90;const i=Math.pow(Math.abs(Math.sin(qt(e))),3);return Math.round(i*(ch.length-1))},e.bg=function(t,i,r,n){const o=i.getNorth(),s=i.getSouth(),a=i.getWest(),l=i.getEast(),c=1<0){const t=180/n;e.bE.multiply(f,f,[t/h+1,0,0,0,t/u+1,0,-.5*t/d,.5*t/p,1])}return f[2]=c,f[5]=t.x,f[8]=t.y,f},e.bh=qu,e.bi=ku,e.bj=function(t,i,r){const n=e.ae.identity(new Float64Array(16)),o=(i/(1<{}}},e.bq=Ng,e.br=li,e.bs=class{isDataAvailableAtPoint(e){const t=this._source();if(this.isUsingMockSource()||!t||e.y<0||e.y>1)return!1;const i=t.getSource().maxzoom,r=1<1)return t;const n=r.getSource().maxzoom,o=1<{const s=this.getAtTileOffset(t,o.x,o.y),a=n.upVector(t.canonical,o.x,o.y),l=n.upVectorScale(t.canonical,i,r).metersToTile;return e.$.scale(a,a,s*l),a}}getForTilePoints(e,t,i,r){if(this.isUsingMockSource())return!1;const n=rf.create(this,e,r);return!!n&&(t.forEach((e=>{e[2]=this.exaggeration()*n.getElevationAt(e[0],e[1],i)})),!0)}getMinMaxForTile(e){if(this.isUsingMockSource())return null;const t=this.findDEMTileFor(e);if(!t||!t.dem)return null;const i=t.dem.tree,r=t.tileID,n=1<=0?e.slice(0,t):e},e.cY=function(e){return e.indexOf(Tl)>=0},e.cZ=function(e){const t=e.indexOf(Tl);return t>=0?e.slice(t+1):""},e.c_=function(e){const t=[],i=e.id;return void 0===i&&t.push({message:`layers.${i}: missing required property "id"`}),void 0===e.render&&t.push({message:`layers.${i}: missing required method "render"`}),e.renderingMode&&"2d"!==e.renderingMode&&"3d"!==e.renderingMode&&t.push({message:`layers.${i}: property "renderingMode" must be either "2d" or "3d"`}),t},e.ca=Nl,e.cb=tc,e.cc=1,e.cd=Kg,e.ce=0,e.cf=ic,e.cg=function(e,t,i,r,n){return Jt((e-t)/(i-t)*(n-r)+r,r,n)},e.ch=Us,e.ci=Oh,e.cj=class{constructor(e,t,i,r){this.context=e,this.format=r,this.size=i,this.texture=e.gl.createTexture();const[n,o,s]=this.size,{gl:a}=e;a.bindTexture(a.TEXTURE_3D,this.texture),e.pixelStoreUnpackFlipY.set(!1),e.pixelStoreUnpack.set(1),e.pixelStoreUnpackPremultiplyAlpha.set(!1);let l=this.format,c=a.UNSIGNED_BYTE;this.format===a.DEPTH_COMPONENT&&(l=a.DEPTH_COMPONENT16,c=a.UNSIGNED_SHORT),this.format===a.R8&&(r=a.RED),this.format===a.R32F&&(c=a.FLOAT,r=a.RED),a.texImage3D(a.TEXTURE_3D,0,l,n,o,s,0,r,c,t.data)}bind(e,t){const{context:i}=this,{gl:r}=i;r.bindTexture(r.TEXTURE_3D,this.texture),e!==this.minFilter&&(r.texParameteri(r.TEXTURE_3D,r.TEXTURE_MAG_FILTER,e),r.texParameteri(r.TEXTURE_3D,r.TEXTURE_MIN_FILTER,e),this.minFilter=e),t!==this.wrapS&&(r.texParameteri(r.TEXTURE_3D,r.TEXTURE_WRAP_S,t),r.texParameteri(r.TEXTURE_3D,r.TEXTURE_WRAP_T,t),this.wrapS=t)}destroy(){const{gl:e}=this.context;e.deleteTexture(this.texture),this.texture=null}},e.ck=jx,e.cl=[1,1,1],e.cm=rf,e.cn=ov,e.co=Zl,e.cp=class{constructor(){this._updateTime=0,this._sourceIds=[],this._activeRegions=[],this._prevRegions=[],this._globalClipBounds={min:new Ut(1/0,1/0),max:new Ut(-1/0,-1/0)}}clear(){this._activeRegions.length>0&&++this._updateTime,this._activeRegions=[],this._prevRegions=[]}get updateTime(){return this._updateTime}getReplacementRegionsForTile(e,t=!1){const i=Fp(new Ut(0,0),new Ut(uo,uo),e),r=[];if(t&&!Op(i,this._globalClipBounds))return r;for(const t of this._activeRegions){if(t.hiddenByOverlap)continue;if(!Op(i,t))continue;const n=Np(t.min,t.max,e);r.push({min:n.min,max:n.max,sourceId:this._sourceIds[t.priority],footprint:t.footprint,footprintTileId:t.tileId,order:t.order,clipMask:t.clipMask,clipScope:t.clipScope})}return r}setSources(e){this._setSources(e.map((e=>({getSourceId:()=>e.cache.id,getFootprints:()=>{const t=[];for(const i of e.cache.getVisibleCoordinates()){const r=e.cache.getTile(i).buckets[e.layer];r&&r.updateFootprints(i.toUnwrapped(),t)}return t},getOrder:()=>e.order,getClipMask:()=>e.clipMask,getClipScope:()=>e.clipScope}))))}_addSource(e){const t=e.getFootprints();if(0===t.length)return;const i=e.getOrder(),r=e.getClipMask(),n=e.getClipScope();for(const e of t){if(!e.footprint)continue;const t=Fp(e.footprint.min,e.footprint.max,e.id);this._activeRegions.push({min:t.min,max:t.max,hiddenByOverlap:!1,priority:this._sourceIds.length,tileId:e.id,footprint:e.footprint,order:i,clipMask:r,clipScope:n})}this._sourceIds.push(e.getSourceId())}_computeReplacement(){this._activeRegions.sort(((e,t)=>e.priority-t.priority||Lp(e.min,t.min)||Lp(e.max,t.max)||e.order-t.order||e.clipMask-t.clipMask||(function(e,t){const i=(e,t)=>e+t;return e.length-t.length||e.reduce(i,"").localeCompare(t.reduce(i,""))})(e.clipScope,t.clipScope)));let e=this._activeRegions.length!==this._prevRegions.length;if(!e){let t=0;for(;!e&&t!==this._activeRegions.length;){const i=this._activeRegions[t],r=this._prevRegions[t];e=i.priority!==r.priority||!kp(i,r)||i.order!==r.order||i.clipMask!==r.clipMask||!jt(i.clipScope,r.clipScope),++t}}if(e){++this._updateTime;for(const e of this._activeRegions)e.order!==Dp&&(this._globalClipBounds.min.x=Math.min(this._globalClipBounds.min.x,e.min.x),this._globalClipBounds.min.y=Math.min(this._globalClipBounds.min.y,e.min.y),this._globalClipBounds.max.x=Math.max(this._globalClipBounds.max.x,e.max.x),this._globalClipBounds.max.y=Math.max(this._globalClipBounds.max.y,e.max.y));const e=e=>{const t=this._activeRegions;if(e>=t.length)return e;const i=t[e].priority;for(;e1){let t=0,i=e(t);for(;t!==i;){let r=t;const n=t;for(;r!==i;){const e=this._activeRegions[r];e.hiddenByOverlap=!1;for(let t=0;t=0;t--)this._addSource(e[t]);this._computeReplacement()}},e.cq=kl,e.cr=Wg,e.cs=nc,e.ct=class{constructor(e){this._createGrid(e),this._createPoles(e)}destroy(){this._poleIndexBuffer.destroy(),this._gridBuffer.destroy(),this._gridIndexBuffer.destroy(),this._poleNorthVertexBuffer.destroy(),this._poleSouthVertexBuffer.destroy();for(const e of this._poleSegments)e.destroy();for(const e of this._gridSegments)e.withSkirts.destroy(),e.withoutSkirts.destroy()}_fillGridMeshWithLods(e,t){const i=new Rl,r=new Jl,n=[],o=e+1+2,s=t[0]+1,a=t[0]+1+(1+t.length),l=(e,t,i)=>{let r=e===o-1?e-2:0===e?e:e-1;return r+=i?24575:0,[r,t]};for(let e=0;ee()))},e.dE=_v,e.dF=Iv,e.dG=function(e){Tv=Li.resolveURL(e),Av||(Av=new mv(bv(),new Br)),Av.broadcast("setDracoUrl",Tv)},e.dH=Cv,e.dI=function(e){Sv=Li.resolveURL(e),Av||(Av=new mv(bv(),new Br)),Av.broadcast("setMeshoptUrl",Sv)},e.dJ=ti,e.dK=wa,e.dL=pd,e.dM=R_,e.dN=og,e.dO=uc,e.dP=pm,e.dQ=Vm,e.dR=em,e.dS=hi,e.dT=C_,e.dU=Bg,e.dV=function(e,t,i,r,n,o,s,a,l,c,h){e.createArrays(),e.tilePixelRatio=uo/(512*e.overscaling),e.compareText={},e.iconsNeedLinear=!1;const u=e.layers[0].layout,d=e.layers[0]._unevaluatedLayout._values,p={};if("composite"===e.textSizeData.kind){const{minZoom:t,maxZoom:i}=e.textSizeData;p.compositeTextSizes=[d["text-size"].possiblyEvaluate(new Ha(t),a),d["text-size"].possiblyEvaluate(new Ha(i),a)]}if("composite"===e.iconSizeData.kind){const{minZoom:t,maxZoom:i}=e.iconSizeData;p.compositeIconSizes=[d["icon-size"].possiblyEvaluate(new Ha(t),a),d["icon-size"].possiblyEvaluate(new Ha(i),a)]}p.layoutTextSize=d["text-size"].possiblyEvaluate(new Ha(l+1),a),p.layoutIconSize=d["icon-size"].possiblyEvaluate(new Ha(l+1),a),p.textMaxSize=d["text-size"].possiblyEvaluate(new Ha(18),a);const f="map"===u.get("text-rotation-alignment")&&"point"!==u.get("symbol-placement"),m=u.get("text-size");let _=!1;for(const t of e.features)if(t.icon&&t.icon.nameSecondary){_=!0;break}for(const o of e.features){const l=u.get("text-font").evaluate(o,{},a).join(","),d=m.evaluate(o,{},a),g=p.layoutTextSize.evaluate(o,{},a),y=(p.layoutIconSize.evaluate(o,{},a),{horizontal:{},vertical:void 0}),x=o.text;let v,b=[0,0];if(x){const r=x.toString(),s=u.get("text-letter-spacing").evaluate(o,{},a)*$m,c=u.get("text-line-height").evaluate(o,{},a)*$m,h=Ca(r)?s:0,p=u.get("text-anchor").evaluate(o,{},a),m=u.get("text-variable-anchor");if(!m){const e=u.get("text-radial-offset").evaluate(o,{},a);b=e?H_(p,[e*$m,Z_]):u.get("text-offset").evaluate(o,{},a).map((e=>e*$m))}let _=f?"center":u.get("text-justify").evaluate(o,{},a);const v="point"===u.get("symbol-placement"),w=v?u.get("text-max-width").evaluate(o,{},a)*$m:1/0,T=o=>{e.allowVerticalPlacement&&Ia(r)&&(y.vertical=o_(x,t,i,n,l,w,c,p,o,h,b,i_.vertical,!0,g,d))};if(!f&&m){const e="auto"===_?m.map((e=>X_(e))):[_];let r=!1;for(let o=0;o=0||!Ia(r)){const e=o_(x,t,i,n,l,w,c,p,_,h,b,i_.horizontal,!1,g,d);e&&(y.horizontal[_]=e)}T(v?"left":_)}}let w=!1;if(o.icon&&o.icon.namePrimary){const t=r[o.icon.namePrimary];t&&(v=m_(n[o.icon.namePrimary],o.icon.nameSecondary?n[o.icon.nameSecondary]:void 0,u.get("icon-offset").evaluate(o,{},a),u.get("icon-anchor").evaluate(o,{},a)),w=t.sdf,void 0===e.sdfIcons?e.sdfIcons=t.sdf:e.sdfIcons!==t.sdf&&fi("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(t.pixelRatio!==e.pixelRatio||0!==u.get("icon-rotate").constantOr(1))&&(e.iconsNeedLinear=!0))}const T=eg(y.horizontal)||y.vertical;e.iconsInText||(e.iconsInText=!!T&&T.iconsInText),(T||v)&&Y_(e,o,y,v,r,p,g,0,b,w,s,a,c,h,_)}o&&e.generateCollisionDebugBuffers(l,e.collisionBoxArray)},e.dW=nm,e.dX=Kd,e.dY=Sp,e.dZ=Om,e.d_=tf,e.da=fh,e.db=r,e.dc=Ku,e.dd=Ju,e.de=function(t){const i=[0,0,0],r=e.ae.identity(new Float64Array(16));return e.ae.multiply(r,t.pixelMatrix,t.globeMatrix),e.$.transformMat4(i,i,r),new Ut(i[0],i[1])},e.df=h,e.dg=c,e.dh=function(e){const t=e.navigator?e.navigator.userAgent:null;return!!(function(e){if(null==Mi){const t=e.navigator?e.navigator.userAgent:null;Mi=!!e.safari||!(!t||!(/\b(iPad|iPhone|iPod)\b/.test(t)||t.match("Safari")&&!t.match("Chrome")))}return Mi})(e)&&t&&(t.match("Version/15.4")||t.match("Version/15.5")||t.match(/CPU (OS|iPhone OS) (15_4|15_5) like Mac OS X/))},e.di=ni,e.dj=class{constructor(e,t,i){this._transformRequestFn=e,this._customAccessToken=t,this._silenceAuthErrors=!!i,this._createSkuToken()}_createSkuToken(){const e=(function(){let e="";for(let t=0;t<10;t++)e+="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"[Math.floor(62*Math.random())];return{token:["1",cr,e].join(""),tokenExpiresAt:Date.now()+432e5}})();this._skuToken=e.token,this._skuTokenExpiresAt=e.tokenExpiresAt}_isSkuTokenExpired(){return Date.now()>this._skuTokenExpiresAt}transformRequest(e,t){return this._transformRequestFn&&this._transformRequestFn(e,t)||{url:e}}normalizeStyleURL(e,i){if(!o(e))return e;const r=dr(e);return r.params.push(`sdk=js-${t}`),r.path=`/styles/v1${r.path}`,this._makeAPIURL(r,this._customAccessToken||i)}normalizeGlyphsURL(e,t){if(!o(e))return e;const i=dr(e);return i.path=`/fonts/v1${i.path}`,this._makeAPIURL(i,this._customAccessToken||t)}normalizeModelURL(e,t){if(!o(e))return e;const i=dr(e);return i.path=`/models/v1${i.path}`,this._makeAPIURL(i,this._customAccessToken||t)}normalizeSourceURL(e,t,i,r){if(!o(e))return e;const n=dr(e);return n.path=`/v4/${n.authority}.json`,n.params.push("secure"),i&&n.params.push(`language=${i}`),r&&n.params.push(`worldview=${r}`),this._makeAPIURL(n,this._customAccessToken||t)}normalizeSpriteURL(e,t,i,r){const n=dr(e);return o(e)?(n.path=`/styles/v1${n.path}/sprite${t}${i}`,this._makeAPIURL(n,this._customAccessToken||r)):(n.path+=`${t}${i}`,pr(n))}normalizeTileURL(e,t,i){if(this._isSkuTokenExpired()&&this._createSkuToken(),e&&!o(e))return e;const n=dr(e);n.path=n.path.replace(/(\.(png|jpg)\d*)(?=$)/,`${t||i&&"raster"!==n.authority&&512===i?"@2x":""}${Zi.supported?".webp":"$1"}`),"raster"===n.authority?n.path=`/${r.RASTER_URL_PREFIX}${n.path}`:"rasterarrays"===n.authority?n.path=`/${r.RASTERARRAYS_URL_PREFIX}${n.path}`:"3dtiles"===n.authority?n.path=`/${r.TILES3D_URL_PREFIX}${n.path}`:(n.path=n.path.replace(/^.+\/v4\//,"/"),n.path=`/${r.TILE_URL_VERSION}${n.path}`);const s=this._customAccessToken||(function(e){for(const t of e){const e=t.match(/^access_token=(.*)$/);if(e)return e[1]}return null})(n.params)||r.ACCESS_TOKEN;return r.REQUIRE_ACCESS_TOKEN&&s&&this._skuToken&&n.params.push(`sku=${this._skuToken}`),this._makeAPIURL(n,s)}canonicalizeTileURL(e,t){const i=dr(e);if(!i.path.match(/^(\/v4\/|\/(raster|rasterarrays)\/v1\/)/)||!i.path.match(/\.[\w]+$/))return e;let n="mapbox://";i.path.match(/^\/raster\/v1\//)?n+=`raster/${i.path.replace(`/${r.RASTER_URL_PREFIX}/`,"")}`:i.path.match(/^\/rasterarrays\/v1\//)?n+=`rasterarrays/${i.path.replace(`/${r.RASTERARRAYS_URL_PREFIX}/`,"")}`:n+=`tiles/${i.path.replace(`/${r.TILE_URL_VERSION}/`,"")}`;let o=i.params;return t&&(o=o.filter((e=>!e.match(/^access_token=/)))),o.length&&(n+=`?${o.join("&")}`),n}canonicalizeTileset(e,t){const i=!!t&&o(t),r=[];for(const t of e.tiles||[])n(t)?r.push(this.canonicalizeTileURL(t,i)):r.push(t);return r}_makeAPIURL(e,t){const i="See https://docs.mapbox.com/api/overview/#access-tokens-and-token-scopes",n=dr(r.API_URL);if(e.protocol=n.protocol,e.authority=n.authority,"http"===e.protocol){const t=e.params.indexOf("secure");t>=0&&e.params.splice(t,1)}if("/"!==n.path&&(e.path=`${n.path}${e.path}`),!r.REQUIRE_ACCESS_TOKEN)return pr(e);if(t=t||r.ACCESS_TOKEN,!this._silenceAuthErrors){if(!t)throw new Error(`An API access token is required to use Mapbox GL. ${i}`);if("s"===t[0])throw new Error(`Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). ${i}`)}return e.params=e.params.filter((e=>-1===e.indexOf("access_token"))),e.params.push(`access_token=${t||""}`),pr(e)}},e.dk=function(e,t){t?Ar.add(e):Ar.delete(e)},e.dl=Zi,e.dm=Er,e.dn=Mr,e.dp=hr,e.dq=vr,e.dr=wr,e.ds=function(e){Ar.delete(e)},e.dt=Sr,e.du=xr,e.dv=ei,e.dw=t,e.dx=function(e,t){Fi=e,Ni=t},e.dy=function(e,t,i=!1){if(Va===Oa||Va===Ba||Va===Fa)throw new Error("setRTLTextPlugin cannot be called multiple times.");Ua=Li.resolveURL(e),Va=Oa,Na=t,$a(),i||Za()},e.dz=qa,e.e=Li,e.e0=Mp,e.e1=pp,e.e2=Nt,e.e3=mm,e.e4=d,e.e5=rr,e.e6=function(e){let t=0;if(new Uint32Array(e,0,1)[0]!==Fv){const i=new Uint32Array(e,0,7),[,,r,n,o,s]=i;t=i.byteLength+n+o+s+o,(r!==e.byteLength||t>=e.byteLength)&&fi("Invalid b3dm header information.")}return Gv(e,t)},e.e7=function(e,t){const i=Kv(e);for(const e of i){for(const t of e.meshes)Qv(t);e.lights&&(e.lightMeshIndex=e.meshes.length,e.meshes.push(eb(e.lights,t)))}return i},e.e8=ab,e.e9=fv,e.ea=Wa,e.eb=function(e){Gi(),Ui&&Ui.then((t=>{t.keys().then((i=>{for(let r=0;re.arrayBuffer())).then((t=>Gv(t,0,e)))},e.m=I_,e.n=class extends Jx{},e.o=In,e.p=ry,e.q=Hr,e.r=Js,e.s=ea,e.t=Qs,e.u=ll,e.v=ha,e.w=fi,e.x=cl,e.y=fa,e.z=ua})),r(0,(function(e){function t(e){const t=e?e.url.toString():void 0;return t?performance.getEntriesByName(t):[]}function i(e){if("number"==typeof e||"boolean"==typeof e||"string"==typeof e||null==e)return JSON.stringify(e);if(Array.isArray(e)){let t="[";for(const r of e)t+=`${i(r)},`;return`${t}]`}let t="{";for(const r of Object.keys(e).sort())t+=`${r}:${i(e[r])},`;return`${t}}`}function r(t){let r="";for(const n of e.cG)r+=`/${i(t[n])}`;return r}class n{constructor(e){this.keyCache={},this._layers={},this._layerConfigs={},e&&this.replace(e)}replace(e,t){this._layerConfigs={},this._layers={},this.update(e,[],t)}update(t,i,n){this._options=n;for(const i of t)this._layerConfigs[i.id]=i,(this._layers[i.id]=e.c$(i,this.scope,null,this._options)).compileFilter(),this.keyCache[i.id]&&delete this.keyCache[i.id];for(const e of i)delete this.keyCache[e],delete this._layerConfigs[e],delete this._layers[e];this.familiesBySource={};const o=(function(e,t){const i={};for(let n=0;nthis._layers[e.id])),i=t[0];if("none"===i.visibility)continue;const r=i.source||"";let n=this.familiesBySource[r];n||(n=this.familiesBySource[r]={});const o=i.sourceLayer||"_geojsonTileLayer";let s=n[o];s||(s=n[o]=[]),s.push(t)}}}const o=1*e.dM;class s{constructor(t){const i={},r=[];for(const e in t){const n=t[e],s=i[e]={};for(const e in n.glyphs){const t=n.glyphs[+e];if(!t||0===t.bitmap.width||0===t.bitmap.height)continue;const i=t.metrics.localGlyph?o:1,a={x:0,y:0,w:t.bitmap.width+2*i,h:t.bitmap.height+2*i};r.push(a),s[e]=a}}const{w:n,h:s}=e.k(r),a=new e.dL({width:n||1,height:s||1});for(const r in t){const n=t[r];for(const t in n.glyphs){const s=n.glyphs[+t];if(!s||0===s.bitmap.width||0===s.bitmap.height)continue;const l=i[r][t],c=s.metrics.localGlyph?o:1;e.dL.copy(s.bitmap,a,{x:0,y:0},{x:l.x+c,y:l.y+c},s.bitmap)}}this.image=a,this.positions=i}}e.dK(s,"GlyphAtlas");class a{constructor(t){this.tileID=new e.aQ(t.tileID.overscaledZ,t.tileID.wrap,t.tileID.canonical.z,t.tileID.canonical.x,t.tileID.canonical.y),this.tileZoom=t.tileZoom,this.uid=t.uid,this.zoom=t.zoom,this.lut=t.lut,this.canonical=t.tileID.canonical,this.pixelRatio=t.pixelRatio,this.tileSize=t.tileSize,this.source=t.source,this.scope=t.scope,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=t.showCollisionBoxes,this.collectResourceTiming=!!t.collectResourceTiming,this.promoteId=t.promoteId,this.isSymbolTile=t.isSymbolTile,this.tileTransform=e.dN(t.tileID.canonical,t.projection),this.projection=t.projection,this.brightness=t.brightness,this.extraShadowCaster=!!t.extraShadowCaster,this.tessellationStep=t.tessellationStep}parse(t,i,r,n,o){this.status="parsing",this.data=t,this.collisionBoxArray=new e.dO;const a=new e.dP(Object.keys(t.layers).sort()),c=new e.dQ(this.tileID,this.promoteId);c.bucketLayerIDs=[];const h={},u=new e.dR(256,256),d={featureIndex:c,iconDependencies:{},patternDependencies:{},glyphDependencies:{},lineAtlas:u,availableImages:r,brightness:this.brightness},p=i.familiesBySource[this.source];for(const i in p){const n=t.layers[i];if(!n)continue;let o=!1,s=!1,u=!1;for(const e of p[i])"symbol"===e[0].type?o=!0:s=!0,e[0].is3D()&&"model"!==e[0].type&&(u=!0);if(this.extraShadowCaster&&!u)continue;if(!0===this.isSymbolTile&&!o)continue;if(!1===this.isSymbolTile&&!s)continue;1===n.version&&e.w(`Vector tile source "${this.source}" layer "${i}" does not use vector tile spec v2 and therefore may have some rendering errors.`);const f=a.encode(i),m=[];for(let e=0;e=t.maxzoom||"none"!==t.visibility&&(l(e,this.zoom,d.brightness,r),(h[t.id]=t.createBucket({index:c.bucketLayerIDs.length,layers:e,zoom:this.zoom,lut:this.lut,canonical:this.canonical,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:f,sourceID:this.source,projection:this.projection.spec,tessellationStep:this.tessellationStep})).populate(m,d,this.tileID.canonical,this.tileTransform),c.bucketLayerIDs.push(e.map((e=>e.id)))))}}let f,m,_,g;u.trim();const y={type:"maybePrepare",isSymbolTile:this.isSymbolTile,zoom:this.zoom},x=()=>{if(f)return this.status="done",o(f);if(this.extraShadowCaster)this.status="done",o(null,{buckets:e.dJ(h).filter((e=>!e.isEmpty())),featureIndex:c,collisionBoxArray:null,glyphAtlasImage:null,lineAtlas:null,imageAtlas:null,brightness:d.brightness,glyphMap:null,iconMap:null,glyphPositions:null});else if(m&&_&&g){const t=new s(m),i=new e.dT(_,g,this.lut);for(const n in h){const o=h[n];o instanceof e.dU?(l(o.layers,this.zoom,d.brightness,r),e.dV(o,m,t.positions,_,i.iconPositions,this.showCollisionBoxes,r,this.tileID.canonical,this.tileZoom,this.projection,this.brightness)):o.hasPattern&&(o instanceof e.dW||o instanceof e.dX||o instanceof e.c0)&&(l(o.layers,this.zoom,d.brightness,r),o.addFeatures(d,this.tileID.canonical,i.patternPositions,r,this.tileTransform,this.brightness))}this.status="done",o(null,{buckets:e.dJ(h).filter((e=>!e.isEmpty())),featureIndex:c,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:t.image,lineAtlas:u,imageAtlas:i,brightness:d.brightness})}};if(!this.extraShadowCaster){const t=e.dS(d.glyphDependencies,(e=>Object.keys(e).map(Number)));Object.keys(t).length?n.send("getGlyphs",{uid:this.uid,stacks:t,scope:this.scope},((e,t)=>{f||(f=e,m=t,x())}),void 0,!1,y):m={};const i=Object.keys(d.iconDependencies);i.length?n.send("getImages",{icons:i,source:this.source,scope:this.scope,tileID:this.tileID,type:"icons"},((e,t)=>{f||(f=e,_=t,x())}),void 0,!1,y):_={};const r=Object.keys(d.patternDependencies);r.length?n.send("getImages",{icons:r,source:this.source,scope:this.scope,tileID:this.tileID,type:"patterns"},((e,t)=>{f||(f=e,g=t,x())}),void 0,!1,y):g={}}x()}}function l(t,i,r,n){const o=new e.Y(i,{brightness:r});for(const e of t)e.recalculate(o,n)}class c extends e.E{constructor(t,i,r,n,o,s){super(),this.actor=t,this.layerIndex=i,this.availableImages=r,this.loadVectorData=o||e.aq,this.loading={},this.loaded={},this.deduped=new e.ap(t.scheduler),this.isSpriteLoaded=n,this.scheduler=t.scheduler,this.brightness=s}loadTile(i,r){const n=i.uid,o=i&&i.request,s=o&&o.collectResourceTiming,l=this.loading[n]=new a(i);l.abort=this.loadVectorData(i,((a,c)=>{const h=!this.loading[n];if(delete this.loading[n],h||a||!c)return l.status="done",h||(this.loaded[n]=l),r(a);const u=c.rawData,d={};c.expires&&(d.expires=c.expires),c.cacheControl&&(d.cacheControl=c.cacheControl),l.vectorTile=c.vectorTile||new e.dY(new e.dZ(u));const p=()=>{l.parse(l.vectorTile,this.layerIndex,this.availableImages,this.actor,((i,n)=>{if(i||!n)return r(i);const a={};if(s){const e=t(o);e.length>0&&(a.resourceTiming=JSON.parse(JSON.stringify(e)))}r(null,e.Q({rawTileData:u.slice(0)},n,d,a))}))};this.isSpriteLoaded?p():this.once("isSpriteLoaded",(()=>{this.scheduler?this.scheduler.add(p,{type:"parseTile",isSymbolTile:i.isSymbolTile,zoom:i.tileZoom}):p()})),this.loaded=this.loaded||{},this.loaded[n]=l}))}reloadTile(t,i){const r=this.loaded,n=t.uid;if(r&&r[n]){const o=r[n];o.showCollisionBoxes=t.showCollisionBoxes,o.projection=t.projection,o.brightness=t.brightness,o.tileTransform=e.dN(t.tileID.canonical,t.projection),o.extraShadowCaster=t.extraShadowCaster,o.lut=t.lut;const s=(e,t)=>{const r=o.reloadCallback;r&&(delete o.reloadCallback,o.parse(o.vectorTile,this.layerIndex,this.availableImages,this.actor,r)),i(e,t)};"parsing"===o.status?o.reloadCallback=s:"done"===o.status&&(o.vectorTile?o.parse(o.vectorTile,this.layerIndex,this.availableImages,this.actor,s):s())}else i(null,void 0)}abortTile(e,t){const i=e.uid,r=this.loading[i];r&&(r.abort&&r.abort(),delete this.loading[i]),t()}removeTile(e,t){const i=this.loaded,r=e.uid;i&&i[r]&&delete i[r],t()}}class h{loadTile(t,i){const{uid:r,encoding:n,rawImageData:o,padding:s}=t,a=ImageBitmap&&o instanceof ImageBitmap?this.getImageData(o,s):o;i(null,new e.d_(r,a,n,s<1))}getImageData(e,t){this.offscreenCanvas&&this.offscreenCanvasContext||(this.offscreenCanvas=new OffscreenCanvas(e.width,e.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d",{willReadFrequently:!0})),this.offscreenCanvas.width=e.width,this.offscreenCanvas.height=e.height,this.offscreenCanvasContext.drawImage(e,0,0,e.width,e.height);const i=this.offscreenCanvasContext.getImageData(-t,-t,e.width+2*t,e.height+2*t);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),i}}e.d$.setPbf(e.dZ);class u{decodeRasterArray({task:t,buffer:i},r){e.d$.performDecoding(i,t).then((e=>{r(null,e)}),(e=>{r(e)}))}}const d=e.e0.prototype.toGeoJSON;let p=class{constructor(t){this._feature=t,this.extent=e.a4,this.type=t.type,this.properties=t.tags,"id"in t&&!isNaN(t.id)&&(this.id=parseInt(t.id,10))}loadGeometry(){if(1===this._feature.type){const t=[];for(const i of this._feature.geometry)t.push([new e.P(i[0],i[1])]);return t}{const t=[];for(const i of this._feature.geometry){const r=[];for(const t of i)r.push(new e.P(t[0],t[1]));t.push(r)}return t}}toGeoJSON(e,t,i){return d.call(this,e,t,i)}},f=class{constructor(t){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=e.a4,this.length=t.length,this._features=t}feature(e){return new p(this._features[e])}};const m=.015625,_=128;class g{constructor(){this.features=new Map}clear(){this.features.clear()}load(e=[],t){for(const i of e){const e=i.id;if(null==e)continue;let r=this.features.get(e);r&&this.updateCache(r,t),i.geometry?(r=x(i),this.updateCache(r,t),this.features.set(e,r)):this.features.delete(e),this.updateCache(r,t)}}updateCache(e,t){for(const{canonical:i,uid:r}of Object.values(t)){const{z:n,x:o,y:s}=i;y(e,Math.pow(2,n),o,s)&&delete t[r]}}getTile(e,t,i){const r=Math.pow(2,e),n=[];for(const e of this.features.values())y(e,r,t,i)&&n.push(T(e,r,t,i));return{features:n}}getFeatures(){return[...this.features.values()]}}function y({minX:e,minY:t,maxX:i,maxY:r},n,o,s){return e<(o+1+m)/n&&t<(s+1+m)/n&&i>(o-m)/n&&r>(s-m)/n}function x(e){const{id:t,geometry:i,properties:r}=e;if(!i)return;if("GeometryCollection"===i.type)throw new Error("GeometryCollection not supported in dynamic mode.");const{type:n,coordinates:o}=i,s={id:t,type:1,geometry:[],tags:r,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0},a=s.geometry;if("Point"===n)v(o,a,s);else if("MultiPoint"===n)for(const e of o)v(e,a,s);else if("LineString"===n)s.type=2,b(o,a,s);else if("MultiLineString"===n)s.type=2,w(o,a,s);else if("Polygon"===n)s.type=3,w(o,a,s,!0);else{if("MultiPolygon"!==n)throw new Error("Input data is not a valid GeoJSON object.");s.type=3;for(const e of o)w(e,a,s,!0)}return s}function v([t,i],r,n){const o=e.ak(t);let s=e.al(i);s=s<0?0:s>1?1:s,r.push(o,s),n.minX=Math.min(n.minX,o),n.minY=Math.min(n.minY,s),n.maxX=Math.max(n.maxX,o),n.maxY=Math.max(n.maxY,s)}function b(e,t,i,r=!1,n=!1){const o=[];for(const t of e)v(t,o,i);t.push(o),r&&(function(e,t){let i=0;for(let t=0,r=e.length,n=r-2;t0===t)for(let t=0,i=e.length;t=a&&d>=a||(h>=a?(u+=Math.round(m*((a-h)/f)),h=a):d>=a&&(p=u+Math.round(m*((a-h)/f)),d=a),u>=a&&p>=a||(u>=a?(h+=Math.round(f*((a-u)/m)),u=a):p>=a&&(d=h+Math.round(f*((a-u)/m)),p=a),l&&h===l[l.length-1][0]&&u===l[l.length-1][1]||(l=[[h,u]],o.push(l)),l.push([d,p])))))}}var S={exports:{}},M=e.e2,A=e.e1.VectorTileFeature,I=C;function C(e,t){this.options=t||{},this.features=e,this.length=e.length}function P(e,t){this.id="number"==typeof e.id?e.id:void 0,this.type=e.type,this.rawGeometry=1===e.type?[e.geometry]:e.geometry,this.properties=e.tags,this.extent=t||4096}C.prototype.feature=function(e){return new P(this.features[e],this.options.extent)},P.prototype.loadGeometry=function(){var e=this.rawGeometry;this.geometry=[];for(var t=0;t>31}function N(e,t){for(var i=e.loadGeometry(),r=e.type,n=0,o=0,s=i.length,a=0;ae},$=Math.fround||(G=new Float32Array(1),e=>(G[0]=+e,G[0]));var G;const q=3,Z=5,W=6;class H{constructor(e){this.options=Object.assign(Object.create(j),e),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(e){const{log:t,minZoom:i,maxZoom:r}=this.options;t&&console.time("total time");const n=`prepare ${e.length} points`;t&&console.time(n),this.points=e;const o=[];for(let t=0;t=i;e--){const i=+Date.now();s=this.trees[e]=this._createTree(this._cluster(s,e)),t&&console.log("z%d: %d clusters in %dms",e,s.numItems,+Date.now()-i)}return t&&console.timeEnd("total time"),this}getClusters(e,t){let i=((e[0]+180)%360+360)%360-180;const r=Math.max(-90,Math.min(90,e[1]));let n=180===e[2]?180:((e[2]+180)%360+360)%360-180;const o=Math.max(-90,Math.min(90,e[3]));if(e[2]-e[0]>=360)i=-180,n=180;else if(i>n){const e=this.getClusters([i,r,180,o],t),s=this.getClusters([-180,r,n,o],t);return e.concat(s)}const s=this.trees[this._limitZoom(t)],a=s.range(J(i),K(o),J(n),K(r)),l=s.data,c=[];for(const e of a){const t=this.stride*e;c.push(l[t+Z]>1?X(l,t,this.clusterProps):this.points[l[t+q]])}return c}getChildren(e){const t=this._getOriginId(e),i=this._getOriginZoom(e),r="No cluster with the specified id.",n=this.trees[i];if(!n)throw new Error(r);const o=n.data;if(t*this.stride>=o.length)throw new Error(r);const s=this.options.radius/(this.options.extent*Math.pow(2,i-1)),a=n.within(o[t*this.stride],o[t*this.stride+1],s),l=[];for(const t of a){const i=t*this.stride;o[i+4]===e&&l.push(o[i+Z]>1?X(o,i,this.clusterProps):this.points[o[i+q]])}if(0===l.length)throw new Error(r);return l}getLeaves(e,t,i){const r=[];return this._appendLeaves(r,e,t=t||10,i=i||0,0),r}getTile(e,t,i){const r=this.trees[this._limitZoom(e)],n=Math.pow(2,e),{extent:o,radius:s}=this.options,a=s/o,l=(i-a)/n,c=(i+1+a)/n,h={features:[]};return this._addTileFeatures(r.range((t-a)/n,l,(t+1+a)/n,c),r.data,t,i,n,h),0===t&&this._addTileFeatures(r.range(1-a/n,l,1,c),r.data,n,i,n,h),t===n-1&&this._addTileFeatures(r.range(0,l,a/n,c),r.data,-1,i,n,h),h.features.length?h:null}getClusterExpansionZoom(e){let t=this._getOriginZoom(e)-1;for(;t<=this.options.maxZoom;){const i=this.getChildren(e);if(t++,1!==i.length)break;e=i[0].properties.cluster_id}return t}_appendLeaves(e,t,i,r,n){const o=this.getChildren(t);for(const t of o){const o=t.properties;if(o&&o.cluster?n+o.point_count<=r?n+=o.point_count:n=this._appendLeaves(e,o.cluster_id,i,r,n):n1;let l,c,h;if(a)l=Y(t,e,this.clusterProps),c=t[e],h=t[e+1];else{const i=this.points[t[e+q]];l=i.properties;const[r,n]=i.geometry.coordinates;c=J(r),h=K(n)}const u={type:1,geometry:[[Math.round(this.options.extent*(c*n-i)),Math.round(this.options.extent*(h*n-r))]],tags:l};let d;d=a||this.options.generateId?t[e+q]:this.points[t[e+q]].id,void 0!==d&&(u.id=d),o.features.push(u)}}_limitZoom(e){return Math.max(this.options.minZoom,Math.min(Math.floor(+e),this.options.maxZoom+1))}_cluster(e,t){const{radius:i,extent:r,reduce:n,minPoints:o}=this.options,s=i/(r*Math.pow(2,t)),a=e.data,l=[],c=this.stride;for(let i=0;it&&(p+=a[i+Z])}if(p>d&&p>=o){let e,o=r*d,s=h*d,f=-1;const m=(i/c<<5)+(t+1)+this.points.length;for(const r of u){const l=r*c;if(a[l+2]<=t)continue;a[l+2]=t;const h=a[l+Z];o+=a[l]*h,s+=a[l+1]*h,a[l+4]=m,n&&(e||(e=this._map(a,i,!0),f=this.clusterProps.length,this.clusterProps.push(e)),n(e,this._map(a,l)))}a[i+4]=m,l.push(o/p,s/p,1/0,m,-1,p),n&&l.push(f)}else{for(let e=0;e1)for(const e of u){const i=e*c;if(!(a[i+2]<=t)){a[i+2]=t;for(let e=0;e>5}_getOriginZoom(e){return(e-this.points.length)%32}_map(e,t,i){if(e[t+Z]>1){const r=this.clusterProps[e[t+W]];return i?Object.assign({},r):r}const r=this.points[e[t+q]].properties,n=this.options.map(r);return i&&n===r?Object.assign({},n):n}}function X(e,t,i){return{type:"Feature",id:e[t+q],properties:Y(e,t,i),geometry:{type:"Point",coordinates:[(r=e[t],360*(r-.5)),Q(e[t+1])]}};var r}function Y(e,t,i){const r=e[t+Z],n=r>=1e4?`${Math.round(r/1e3)}k`:r>=1e3?Math.round(r/100)/10+"k":r,o=e[t+W],s=-1===o?{}:Object.assign({},i[o]);return Object.assign(s,{cluster:!0,cluster_id:e[t+q],point_count:r,point_count_abbreviated:n})}function J(e){return e/360+.5}function K(e){const t=Math.sin(e*Math.PI/180),i=.5-.25*Math.log((1+t)/(1-t))/Math.PI;return i<0?0:i>1?1:i}function Q(e){const t=(180-360*e)*Math.PI/180;return 360*Math.atan(Math.exp(t))/Math.PI-90}function ee(e,t,i,r){let n=r;const o=t+(i-t>>1);let s,a=i-t;const l=e[t],c=e[t+1],h=e[i],u=e[i+1];for(let r=t+3;rn)s=r,n=t;else if(t===n){const e=Math.abs(r-o);er&&(s-t>3&&ee(e,t,s,r),e[s+2]=n,i-s>3&&ee(e,s,i,r))}function te(e,t,i,r,n,o){let s=n-i,a=o-r;if(0!==s||0!==a){const l=((e-i)*s+(t-r)*a)/(s*s+a*a);l>1?(i=n,r=o):l>0&&(i+=s*l,r+=a*l)}return s=e-i,a=t-r,s*s+a*a}function ie(e,t,i,r){const n={id:e??null,type:t,geometry:i,tags:r,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};if("Point"===t||"MultiPoint"===t||"LineString"===t)re(n,i);else if("Polygon"===t)re(n,i[0]);else if("MultiLineString"===t)for(const e of i)re(n,e);else if("MultiPolygon"===t)for(const e of i)re(n,e[0]);return n}function re(e,t){for(let i=0;i0&&(s+=r?(n*l-a*o)/2:Math.sqrt(Math.pow(a-n,2)+Math.pow(l-o,2))),n=a,o=l}const a=t.length-3;t[2]=1,ee(t,0,a,i),t[a+2]=1,t.size=Math.abs(s),t.start=0,t.end=t.size}function ae(e,t,i,r){for(let n=0;n1?1:i}function he(e,t,i,r,n,o,s,a){if(r/=t,o>=(i/=t)&&s=r)return null;const l=[];for(const t of e){const e=t.geometry;let o=t.type;const s=0===n?t.minX:t.minY,c=0===n?t.maxX:t.maxY;if(s>=i&&c=r)continue;let h=[];if("Point"===o||"MultiPoint"===o)ue(e,h,i,r,n);else if("LineString"===o)de(e,h,i,r,n,!1,a.lineMetrics);else if("MultiLineString"===o)fe(e,h,i,r,n,!1);else if("Polygon"===o)fe(e,h,i,r,n,!0);else if("MultiPolygon"===o)for(const t of e){const e=[];fe(t,e,i,r,n,!0),e.length&&h.push(e)}if(h.length){if(a.lineMetrics&&"LineString"===o){for(const e of h)l.push(ie(t.id,o,e,t.tags));continue}"LineString"!==o&&"MultiLineString"!==o||(1===h.length?(o="LineString",h=h[0]):o="MultiLineString"),"Point"!==o&&"MultiPoint"!==o||(o=3===h.length?"Point":"MultiPoint"),l.push(ie(t.id,o,h,t.tags))}}return l.length?l:null}function ue(e,t,i,r,n){for(let o=0;o=i&&s<=r&&me(t,e[o],e[o+1],e[o+2])}}function de(e,t,i,r,n,o,s){let a=pe(e);const l=0===n?_e:ge;let c,h,u=e.start;for(let d=0;di&&(h=l(a,p,f,_,g,i),s&&(a.start=u+c*h)):y>r?x=i&&(h=l(a,p,f,_,g,i),v=!0),x>r&&y<=r&&(h=l(a,p,f,_,g,r),v=!0),!o&&v&&(s&&(a.end=u+c*h),t.push(a),a=pe(e)),s&&(u+=c)}let d=e.length-3;const p=e[d],f=e[d+1],m=0===n?p:f;m>=i&&m<=r&&me(a,p,f,e[d+2]),d=a.length-3,o&&d>=3&&(a[d]!==a[0]||a[d+1]!==a[1])&&me(a,a[0],a[1],a[2]),a.length&&t.push(a)}function pe(e){const t=[];return t.size=e.size,t.start=e.start,t.end=e.end,t}function fe(e,t,i,r,n,o){for(const s of e)de(s,t,i,r,n,o,!1)}function me(e,t,i,r){e.push(t,i,r)}function _e(e,t,i,r,n,o){const s=(o-t)/(r-t);return me(e,o,i+(n-i)*s,1),s}function ge(e,t,i,r,n,o){const s=(o-i)/(n-i);return me(e,t+(r-t)*s,o,1),s}function ye(e,t){const i=[];for(let r=0;r0&&t.size<(n?s:r))return void(i.numPoints+=t.length/3);const a=[];for(let e=0;es)&&(i.numSimplified++,a.push(t[e],t[e+1])),i.numPoints++;n&&(function(e,t){let i=0;for(let t=0,r=e.length,n=r-2;t0===t)for(let t=0,i=e.length;t24)throw new Error("maxZoom should be in the 0-24 range");if(t.promoteId&&t.generateId)throw new Error("promoteId and generateId cannot be used together.");let r=(function(e,t){const i=[];if("FeatureCollection"===e.type)for(let r=0;r1&&console.time("creation"),d=this.tiles[u]=we(e,t,i,r,l),this.tileCoords.push({z:t,x:i,y:r}),c)){c>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",t,i,r,d.numFeatures,d.numPoints,d.numSimplified),console.timeEnd("creation"));const e=`z${t}`;this.stats[e]=(this.stats[e]||0)+1,this.total++}if(d.source=e,null==n){if(t===l.indexMaxZoom||d.numPoints<=l.indexMaxPoints)continue}else{if(t===l.maxZoom||t===n)continue;if(null!=n){const e=n-t;if(i!==o>>e||r!==s>>e)continue}}if(d.source=null,0===e.length)continue;c>1&&console.time("clipping");const p=.5*l.buffer/l.extent,f=.5-p,m=.5+p,_=1+p;let g=null,y=null,x=null,v=null,b=he(e,h,i-p,i+m,0,d.minX,d.maxX,l),w=he(e,h,i+f,i+_,0,d.minX,d.maxX,l);e=null,b&&(g=he(b,h,r-p,r+m,1,d.minY,d.maxY,l),y=he(b,h,r+f,r+_,1,d.minY,d.maxY,l),b=null),w&&(x=he(w,h,r-p,r+m,1,d.minY,d.maxY,l),v=he(w,h,r+f,r+_,1,d.minY,d.maxY,l),w=null),c>1&&console.timeEnd("clipping"),a.push(g||[],t+1,2*i,2*r),a.push(y||[],t+1,2*i,2*r+1),a.push(x||[],t+1,2*i+1,2*r),a.push(v||[],t+1,2*i+1,2*r+1)}}getTile(e,t,i){e=+e,t=+t,i=+i;const r=this.options,{extent:n,debug:o}=r;if(e<0||e>24)return null;const s=1<1&&console.log("drilling down to z%d-%d-%d",e,t,i);let l,c=e,h=t,u=i;for(;!l&&c>0;)c--,h>>=1,u>>=1,l=this.tiles[Ae(c,h,u)];return l&&l.source?(o>1&&(console.log("found parent tile z%d-%d-%d",c,h,u),console.time("drilling down")),this.splitTile(l.source,c,h,u,e,t,i),o>1&&console.timeEnd("drilling down"),this.tiles[a]?ve(this.tiles[a],n):null):null}}function Ae(e,t,i){return 32*((1<{if(s||!a)return r(s);if("object"!=typeof a)return r(new Error(`Input data given to '${i.source}' is not a valid GeoJSON object.`));{try{if(i.filter){const t=e.z(i.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if("error"===t.result)throw new Error(t.value.map((e=>`${e.key}: ${e.message}`)).join(", "));a.features=a.features.filter((e=>t.value.evaluate({zoom:0},e)))}i.dynamic?("Feature"===a.type&&(a={type:"FeatureCollection",features:[a]}),i.append||(this._dynamicIndex.clear(),this.loaded={}),this._dynamicIndex.load(a.features,this.loaded),i.cluster&&(a.features=this._dynamicIndex.getFeatures())):this.loaded={},this._geoJSONIndex=i.cluster?new H((function({superclusterOptions:t,clusterProperties:i}){if(!i||!t)return t;const r={},n={},o={accumulated:null,zoom:0},s={properties:null},a=Object.keys(i);for(const t of a){const[o,s]=i[t],a=e.z(s),l=e.z("string"==typeof o?[o,["accumulated"],["get",t]]:o);r[t]=a.value,n[t]=l.value}return t.map=e=>{s.properties=e;const t={};for(const e of a)t[e]=r[e].evaluate(o,s);return t},t.reduce=(e,t)=>{s.properties=t;for(const t of a)o.accumulated=e[t],e[t]=n[t].evaluate(o,s)},t})(i)).load(a.features):i.dynamic?this._dynamicIndex:(function(e,t){return new Me(e,t)})(a,i.geojsonVtOptions)}catch(e){return r(e)}const s={};if(o){const e=t(n);e&&(s.resourceTiming={},s.resourceTiming[i.source]=JSON.parse(JSON.stringify(e)))}r(null,s)}}))}reloadTile(e,t){const i=this.loaded;return i&&i[e.uid]?e.partial?t(null,void 0):super.reloadTile(e,t):this.loadTile(e,t)}loadGeoJSON(t,i){if(t.request)e.h(t.request,i);else{if("string"!=typeof t.data)return i(new Error(`Input data given to '${t.source}' is not a valid GeoJSON object.`));try{return i(null,JSON.parse(t.data))}catch(e){return i(new Error(`Input data given to '${t.source}' is not a valid GeoJSON object.`))}}}getClusterExpansionZoom(e,t){try{t(null,this._geoJSONIndex.getClusterExpansionZoom(e.clusterId))}catch(e){t(e)}}getClusterChildren(e,t){try{t(null,this._geoJSONIndex.getChildren(e.clusterId))}catch(e){t(e)}}getClusterLeaves(e,t){try{t(null,this._geoJSONIndex.getLeaves(e.clusterId,e.limit,e.offset))}catch(e){t(e)}}}class Pe{constructor(t,i){this.tileID=new e.aQ(t.tileID.overscaledZ,t.tileID.wrap,t.tileID.canonical.z,t.tileID.canonical.x,t.tileID.canonical.y),this.tileZoom=t.tileZoom,this.uid=t.uid,this.zoom=t.zoom,this.canonical=t.tileID.canonical,this.pixelRatio=t.pixelRatio,this.tileSize=t.tileSize,this.source=t.source,this.overscaling=this.tileID.overscaleFactor(),this.projection=t.projection,this.brightness=i}parse(t,i,r,n){this.status="parsing";const o=new e.aQ(r.tileID.overscaledZ,r.tileID.wrap,r.tileID.canonical.z,r.tileID.canonical.x,r.tileID.canonical.y),s={},a=i.familiesBySource[r.source],l=new e.dQ(o,r.promoteId);return l.bucketLayerIDs=[],l.is3DTile=!0,e.e6(t).then((t=>{if(!t)return n(new Error("Could not parse tile"));const i=e.e7(t,1/e.b7(r.tileID.canonical)),c=t.json.extensionsUsed&&t.json.extensionsUsed.includes("MAPBOX_mesh_features")||t.json.asset.extras&&t.json.asset.extras.MAPBOX_mesh_features,h=t.json.extensionsUsed&&t.json.extensionsUsed.includes("EXT_meshopt_compression"),u=new e.Y(this.zoom,{brightness:this.brightness});for(const t in a)for(const r of a[t]){const t=r[0];l.bucketLayerIDs.push(r.map((e=>e.id))),t.recalculate(u,[]);const n=new e.e8(i,o,c,h,this.brightness,l);c||(n.needsUpload=!0),s[t.fqid]=n,n.evaluate(t)}this.status="done",n(null,{buckets:s,featureIndex:l})})).catch((e=>n(new Error(e.message))))}}class ze{constructor(e,t,i,r,n,o){this.actor=e,this.layerIndex=t,this.brightness=o,this.loading={},this.loaded={}}loadTile(t,i){const r=t.uid,n=this.loading[r]=new Pe(t,this.brightness);e.e5(t.request,((e,o)=>{const s=!this.loading[r];return delete this.loading[r],s||e?(n.status="done",s||(this.loaded[r]=n),i(e)):o&&0!==o.byteLength?void n.parse(o,this.layerIndex,t,((e,t)=>{n.status="done",this.loaded=this.loaded||{},this.loaded[r]=n,e||!t?i(e):i(null,t)})):(n.status="done",this.loaded[r]=n,i())}))}reloadTile(e,t){const i=this.loaded,r=e.uid;if(i&&i[r]){const n=i[r];n.projection=e.projection,n.brightness=e.brightness;const o=(i,r)=>{n.reloadCallback&&(delete n.reloadCallback,this.loadTile(e,t)),t(i,r)};"parsing"===n.status?n.reloadCallback=o:"done"===n.status&&this.loadTile(e,t)}}abortTile(e,t){const i=e.uid;this.loading[i]&&delete this.loading[i],t()}removeTile(e,t){const i=this.loaded,r=e.uid;i&&i[r]&&delete i[r],t()}}class De{constructor(t){this.self=t,this.actor=new e.e9(t,this),this.layerIndexes={},this.availableImages={},this.isSpriteLoaded={},this.projections={},this.defaultProjection=e.aK({name:"mercator"}),this.workerSourceTypes={vector:c,geojson:Ce,"batched-model":ze},this.workerSources={},this.demWorkerSources={},this.self.registerWorkerSource=(e,t)=>{if(this.workerSourceTypes[e])throw new Error(`Worker source with name "${e}" already registered.`);this.workerSourceTypes[e]=t},this.self.registerRTLTextPlugin=t=>{if(e.ea.isParsed())throw new Error("RTL text plugin already registered.");e.ea.applyArabicShaping=t.applyArabicShaping,e.ea.processBidirectionalText=t.processBidirectionalText,e.ea.processStyledBidirectionalText=t.processStyledBidirectionalText}}clearCaches(e,t,i){delete this.layerIndexes[e],delete this.availableImages[e],delete this.workerSources[e],delete this.demWorkerSources[e],delete this.rasterArrayWorkerSource,i()}checkIfReady(e,t,i){i()}setReferrer(e,t){this.referrer=t}spriteLoaded(t,{scope:i,isLoaded:r}){if(this.isSpriteLoaded[t]||(this.isSpriteLoaded[t]={}),this.isSpriteLoaded[t][i]=r,this.workerSources[t]&&this.workerSources[t][i])for(const n in this.workerSources[t][i]){const o=this.workerSources[t][i][n];for(const t in o){const i=o[t];i instanceof c&&(i.isSpriteLoaded=r,i.fire(new e.g("isSpriteLoaded")))}}}setImages(e,{scope:t,images:i},r){if(this.availableImages[e]||(this.availableImages[e]={}),this.availableImages[e][t]=i,this.workerSources[e]&&this.workerSources[e][t]){for(const r in this.workerSources[e][t]){const n=this.workerSources[e][t][r];for(const e in n)n[e].availableImages=i}r()}else r()}setProjection(t,i){this.projections[t]=e.aK(i)}setBrightness(e,t,i){this.brightness=t,i()}setLayers(e,t,i){this.getLayerIndex(e,t.scope).replace(t.layers,t.options),i()}updateLayers(e,t,i){this.getLayerIndex(e,t.scope).update(t.layers,t.removedIds,t.options),i()}loadTile(e,t,i){t.projection=this.projections[e]||this.defaultProjection,this.getWorkerSource(e,t.type,t.source,t.scope).loadTile(t,i)}loadDEMTile(e,t,i){this.getDEMWorkerSource(e,t.source,t.scope).loadTile(t,i)}decodeRasterArray(e,t,i){this.getRasterArrayWorkerSource().decodeRasterArray(t,i)}reloadTile(e,t,i){t.projection=this.projections[e]||this.defaultProjection,this.getWorkerSource(e,t.type,t.source,t.scope).reloadTile(t,i)}abortTile(e,t,i){this.getWorkerSource(e,t.type,t.source,t.scope).abortTile(t,i)}removeTile(e,t,i){this.getWorkerSource(e,t.type,t.source,t.scope).removeTile(t,i)}removeSource(e,t,i){if(!(this.workerSources[e]&&this.workerSources[e][t.scope]&&this.workerSources[e][t.scope][t.type]&&this.workerSources[e][t.scope][t.type][t.source]))return;const r=this.workerSources[e][t.scope][t.type][t.source];delete this.workerSources[e][t.scope][t.type][t.source],void 0!==r.removeSource?r.removeSource(t,i):i()}loadWorkerSource(e,t,i){try{this.self.importScripts(t.url),i()}catch(e){i(e.toString())}}syncRTLPluginState(t,i,r){try{e.ea.setState(i);const t=e.ea.getPluginURL();if(e.ea.isLoaded()&&!e.ea.isParsed()&&null!=t){this.self.importScripts(t);const i=e.ea.isParsed();r(i?void 0:new Error(`RTL Text Plugin failed to import scripts from ${t}`),i)}}catch(e){r(e.toString())}}setDracoUrl(e,t){this.dracoUrl=t}getAvailableImages(e,t){this.availableImages[e]||(this.availableImages[e]={});let i=this.availableImages[e][t];return i||(i=[]),i}getLayerIndex(e,t){this.layerIndexes[e]||(this.layerIndexes[e]={});let i=this.layerIndexes[e][t];return i||(i=this.layerIndexes[e][t]=new n,i.scope=t),i}getWorkerSource(e,t,i,r){return this.workerSources[e]||(this.workerSources[e]={}),this.workerSources[e][r]||(this.workerSources[e][r]={}),this.workerSources[e][r][t]||(this.workerSources[e][r][t]={}),this.isSpriteLoaded[e]||(this.isSpriteLoaded[e]={}),this.workerSources[e][r][t][i]||(this.workerSources[e][r][t][i]=new this.workerSourceTypes[t]({send:(t,i,r,n,o,s)=>{this.actor.send(t,i,r,e,o,s)},scheduler:this.actor.scheduler},this.getLayerIndex(e,r),this.getAvailableImages(e,r),this.isSpriteLoaded[e][r],void 0,this.brightness)),this.workerSources[e][r][t][i]}getDEMWorkerSource(e,t,i){return this.demWorkerSources[e]||(this.demWorkerSources[e]={}),this.demWorkerSources[e][i]||(this.demWorkerSources[e][i]={}),this.demWorkerSources[e][i][t]||(this.demWorkerSources[e][i][t]=new h),this.demWorkerSources[e][i][t]}getRasterArrayWorkerSource(){return this.rasterArrayWorkerSource||(this.rasterArrayWorkerSource=new u),this.rasterArrayWorkerSource}enforceCacheSizeLimit(t,i){e.eb(i)}getWorkerPerformanceMetrics(e,t,i){i(void 0,void 0)}}return"undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof self&&self instanceof WorkerGlobalScope&&(self.worker=new De(self)),De})),r(0,(function(e){var t=i;function i(e){return!(function(e){return"undefined"==typeof document?"not a browser":(function(){if(!("Worker"in window&&"Blob"in window&&"URL"in window))return!1;var e,t,i=new Blob([""],{type:"text/javascript"}),r=URL.createObjectURL(i);try{t=new Worker(r),e=!0}catch(t){e=!1}return t&&t.terminate(),URL.revokeObjectURL(r),e})()?(function(){var e=document.createElement("canvas");e.width=e.height=1;var t=e.getContext("2d");if(!t)return!1;var i=t.getImageData(0,0,1,1);return i&&i.width===e.width})()?(void 0===r[t=e&&e.failIfMajorPerformanceCaveat]&&(r[t]=(function(e){var t,r=(function(e){var t=document.createElement("canvas"),r=Object.create(i.webGLContextAttributes);return r.failIfMajorPerformanceCaveat=e,t.getContext("webgl2",r)})(e);if(!r)return!1;try{t=r.createShader(r.VERTEX_SHADER)}catch(e){return!1}return!(!t||r.isContextLost())&&(r.shaderSource(t,"void main() {}"),r.compileShader(t),!0===r.getShaderParameter(t,r.COMPILE_STATUS))})(t)),r[t]?document.documentMode?"insufficient ECMAScript 6 support":void 0:"insufficient WebGL2 support"):"insufficient Canvas/getImageData support":"insufficient worker support";var t})(e)}var r={};function n(e,t,i){const r=document.createElement(e);return null!=t&&(r.className=t),i&&i.appendChild(r),r}function o(e,t,i){const r=document.createElementNS("http://www.w3.org/2000/svg",e);for(const e of Object.keys(t))r.setAttributeNS(null,e,String(t[e]));return i&&i.appendChild(r),r}i.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0};const s="undefined"!=typeof document?document.documentElement&&document.documentElement.style:null,h=s&&void 0!==s.userSelect?"userSelect":"WebkitUserSelect";let u;function d(){s&&h&&(u=s[h],s[h]="none")}function p(){s&&h&&(s[h]=u)}function f(e){e.preventDefault(),e.stopPropagation(),window.removeEventListener("click",f,!0)}function m(){window.addEventListener("click",f,!0),window.setTimeout((()=>{window.removeEventListener("click",f,!0)}),0)}function _(e,t){const i=e.getBoundingClientRect();return x(e,i,t)}function g(e,t){const i=e.getBoundingClientRect(),r=[];for(let n=0;n=0?0:e.button}function x(t,i,r){const n=t.offsetWidth===i.width?1:t.offsetWidth/i.width;return new e.P((r.clientX-i.left)*n,(r.clientY-i.top)*n)}class v{constructor(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSourceCaches={},this._updatedPaintProps=new Set,this._updatedImages=new Set}isDirty(){return this._changed}setDirty(){this._changed=!0}getUpdatedSourceCaches(){return this._updatedSourceCaches}updateSourceCache(e,t){this._updatedSourceCaches[e]=t,this.setDirty()}discardSourceCacheUpdate(e){delete this._updatedSourceCaches[e]}updateLayer(e){const t=e.scope;this._updatedLayers[t]=this._updatedLayers[t]||new Set,this._updatedLayers[t].add(e.id),this.setDirty()}removeLayer(e){const t=e.scope;this._removedLayers[t]=this._removedLayers[t]||{},this._updatedLayers[t]=this._updatedLayers[t]||new Set,this._removedLayers[t][e.id]=e,this._updatedLayers[t].delete(e.id),this._updatedPaintProps.delete(e.fqid),this.setDirty()}getRemovedLayer(e){return this._removedLayers[e.scope]?this._removedLayers[e.scope][e.id]:null}discardLayerRemoval(e){this._removedLayers[e.scope]&&delete this._removedLayers[e.scope][e.id]}getLayerUpdatesByScope(){const e={};for(const t in this._updatedLayers)e[t]=e[t]||{},e[t].updatedIds=Array.from(this._updatedLayers[t].values());for(const t in this._removedLayers)e[t]=e[t]||{},e[t].removedIds=Object.keys(this._removedLayers[t]);return e}getUpdatedPaintProperties(){return this._updatedPaintProps}updatePaintProperties(e){this._updatedPaintProps.add(e.fqid),this.setDirty()}getUpdatedImages(){return Array.from(this._updatedImages.values())}updateImage(e){this._updatedImages.add(e),this.setDirty()}resetUpdatedImages(){this._updatedImages.clear()}reset(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSourceCaches={},this._updatedPaintProps.clear(),this._updatedImages.clear()}}const b={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class w{constructor(e,t,i,r,n,o){this.length=t.length,this.attributes=i,this.itemSize=t.bytesPerElement,this.dynamicDraw=r,this.instanceCount=o,this.context=e;const s=e.gl;this.buffer=s.createBuffer(),e.bindVertexBuffer.set(this.buffer),s.bufferData(s.ARRAY_BUFFER,t.arrayBuffer,this.dynamicDraw?s.DYNAMIC_DRAW:s.STATIC_DRAW),this.dynamicDraw||n||t.destroy()}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(e){const t=this.context.gl;this.bind(),t.bufferSubData(t.ARRAY_BUFFER,0,e.arrayBuffer)}enableAttributes(e,t){for(let i=0;i0&&e.vertexAttribDivisor(n,i)}}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}class T{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 E extends T{getDefault(){return e.C.transparent}set(e){const t=this.current;(e.r!==t.r||e.g!==t.g||e.b!==t.b||e.a!==t.a||this.dirty)&&(this.gl.clearColor(e.r,e.g,e.b,e.a),this.current=e,this.dirty=!1)}}class S extends T{getDefault(){return 1}set(e){(e!==this.current||this.dirty)&&(this.gl.clearDepth(e),this.current=e,this.dirty=!1)}}class M extends T{getDefault(){return 0}set(e){(e!==this.current||this.dirty)&&(this.gl.clearStencil(e),this.current=e,this.dirty=!1)}}class A extends T{getDefault(){return[!0,!0,!0,!0]}set(e){const t=this.current;(e[0]!==t[0]||e[1]!==t[1]||e[2]!==t[2]||e[3]!==t[3]||this.dirty)&&(this.gl.colorMask(e[0],e[1],e[2],e[3]),this.current=e,this.dirty=!1)}}class I extends T{getDefault(){return!0}set(e){(e!==this.current||this.dirty)&&(this.gl.depthMask(e),this.current=e,this.dirty=!1)}}class C extends T{getDefault(){return 255}set(e){(e!==this.current||this.dirty)&&(this.gl.stencilMask(e),this.current=e,this.dirty=!1)}}class P extends T{getDefault(){return{func:this.gl.ALWAYS,ref:0,mask:255}}set(e){const t=this.current;(e.func!==t.func||e.ref!==t.ref||e.mask!==t.mask||this.dirty)&&(this.gl.stencilFunc(e.func,e.ref,e.mask),this.current=e,this.dirty=!1)}}class z extends T{getDefault(){const e=this.gl;return[e.KEEP,e.KEEP,e.KEEP]}set(e){const t=this.current;(e[0]!==t[0]||e[1]!==t[1]||e[2]!==t[2]||this.dirty)&&(this.gl.stencilOp(e[0],e[1],e[2]),this.current=e,this.dirty=!1)}}class D extends T{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;const t=this.gl;e?t.enable(t.STENCIL_TEST):t.disable(t.STENCIL_TEST),this.current=e,this.dirty=!1}}class R extends T{getDefault(){return[0,1]}set(e){const t=this.current;(e[0]!==t[0]||e[1]!==t[1]||this.dirty)&&(this.gl.depthRange(e[0],e[1]),this.current=e,this.dirty=!1)}}class L extends T{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;const t=this.gl;e?t.enable(t.DEPTH_TEST):t.disable(t.DEPTH_TEST),this.current=e,this.dirty=!1}}class k extends T{getDefault(){return this.gl.LESS}set(e){(e!==this.current||this.dirty)&&(this.gl.depthFunc(e),this.current=e,this.dirty=!1)}}class O extends T{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;const t=this.gl;e?t.enable(t.BLEND):t.disable(t.BLEND),this.current=e,this.dirty=!1}}class B extends T{getDefault(){const e=this.gl;return[e.ONE,e.ZERO,e.ONE,e.ZERO]}set(e){const t=this.current;(e[0]!==t[0]||e[1]!==t[1]||e[2]!==t[2]||e[3]!==t[3]||this.dirty)&&(this.gl.blendFuncSeparate(e[0],e[1],e[2],e[3]),this.current=e,this.dirty=!1)}}class F extends T{getDefault(){return e.C.transparent}set(e){const t=this.current;(e.r!==t.r||e.g!==t.g||e.b!==t.b||e.a!==t.a||this.dirty)&&(this.gl.blendColor(e.r,e.g,e.b,e.a),this.current=e,this.dirty=!1)}}class N extends T{getDefault(){return this.gl.FUNC_ADD}set(e){(e!==this.current||this.dirty)&&(this.gl.blendEquationSeparate(e,e),this.current=e,this.dirty=!1)}}class V extends T{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;const t=this.gl;e?t.enable(t.CULL_FACE):t.disable(t.CULL_FACE),this.current=e,this.dirty=!1}}class U extends T{getDefault(){return this.gl.BACK}set(e){(e!==this.current||this.dirty)&&(this.gl.cullFace(e),this.current=e,this.dirty=!1)}}class j extends T{getDefault(){return this.gl.CCW}set(e){(e!==this.current||this.dirty)&&(this.gl.frontFace(e),this.current=e,this.dirty=!1)}}let $=class extends T{getDefault(){return null}set(e){(e!==this.current||this.dirty)&&(this.gl.useProgram(e),this.current=e,this.dirty=!1)}};class G extends T{getDefault(){return this.gl.TEXTURE0}set(e){(e!==this.current||this.dirty)&&(this.gl.activeTexture(e),this.current=e,this.dirty=!1)}}class q extends T{getDefault(){const e=this.gl;return[0,0,e.drawingBufferWidth,e.drawingBufferHeight]}set(e){const t=this.current;(e[0]!==t[0]||e[1]!==t[1]||e[2]!==t[2]||e[3]!==t[3]||this.dirty)&&(this.gl.viewport(e[0],e[1],e[2],e[3]),this.current=e,this.dirty=!1)}}class Z extends T{getDefault(){return null}set(e){if(e===this.current&&!this.dirty)return;const t=this.gl;t.bindFramebuffer(t.FRAMEBUFFER,e),this.current=e,this.dirty=!1}}class W extends T{getDefault(){return null}set(e){if(e===this.current&&!this.dirty)return;const t=this.gl;t.bindRenderbuffer(t.RENDERBUFFER,e),this.current=e,this.dirty=!1}}class H extends T{getDefault(){return null}set(e){if(e===this.current&&!this.dirty)return;const t=this.gl;t.bindTexture(t.TEXTURE_2D,e),this.current=e,this.dirty=!1}}class X extends T{getDefault(){return null}set(e){if(e===this.current&&!this.dirty)return;const t=this.gl;t.bindBuffer(t.ARRAY_BUFFER,e),this.current=e,this.dirty=!1}}class Y extends T{getDefault(){return null}set(e){const t=this.gl;t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,e),this.current=e,this.dirty=!1}}class J extends T{getDefault(){return null}set(e){this.gl&&(e!==this.current||this.dirty)&&(this.gl.bindVertexArray(e),this.current=e,this.dirty=!1)}}class K extends T{getDefault(){return 4}set(e){if(e===this.current&&!this.dirty)return;const t=this.gl;t.pixelStorei(t.UNPACK_ALIGNMENT,e),this.current=e,this.dirty=!1}}class Q extends T{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;const t=this.gl;t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e),this.current=e,this.dirty=!1}}class ee extends T{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;const t=this.gl;t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,e),this.current=e,this.dirty=!1}}class te extends T{constructor(e,t){super(e),this.context=e,this.parent=t}getDefault(){return null}}class ie extends te{setDirty(){this.dirty=!0}set(e){if(e===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const t=this.gl;t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,e,0),this.current=e,this.dirty=!1}}class re extends te{attachment(){return this.gl.DEPTH_ATTACHMENT}set(e){if(e===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const t=this.gl;t.framebufferRenderbuffer(t.FRAMEBUFFER,this.attachment(),t.RENDERBUFFER,e),this.current=e,this.dirty=!1}}class ne extends te{attachment(){return this.gl.DEPTH_ATTACHMENT}set(e){if(e===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const t=this.gl;t.framebufferTexture2D(t.FRAMEBUFFER,this.attachment(),t.TEXTURE_2D,e,0),this.current=e,this.dirty=!1}}class oe extends re{attachment(){return this.gl.DEPTH_STENCIL_ATTACHMENT}}class se{constructor(e,t,i,r,n){this.context=e,this.width=t,this.height=i;const o=this.framebuffer=e.gl.createFramebuffer();r&&(this.colorAttachment=new ie(e,o)),n&&(this.depthAttachmentType=n,this.depthAttachment="renderbuffer"===n?new re(e,o):new ne(e,o))}destroy(){const e=this.context.gl;if(this.colorAttachment){const t=this.colorAttachment.get();t&&e.deleteTexture(t)}if(this.depthAttachment&&this.depthAttachmentType)if("renderbuffer"===this.depthAttachmentType){const t=this.depthAttachment.get();t&&e.deleteRenderbuffer(t)}else{const t=this.depthAttachment.get();t&&e.deleteTexture(t)}e.deleteFramebuffer(this.framebuffer)}}class ae{constructor(e,t){this.gl=e,this.clearColor=new E(this),this.clearDepth=new S(this),this.clearStencil=new M(this),this.colorMask=new A(this),this.depthMask=new I(this),this.stencilMask=new C(this),this.stencilFunc=new P(this),this.stencilOp=new z(this),this.stencilTest=new D(this),this.depthRange=new R(this),this.depthTest=new L(this),this.depthFunc=new k(this),this.blend=new O(this),this.blendFunc=new B(this),this.blendColor=new F(this),this.blendEquation=new N(this),this.cullFace=new V(this),this.cullFaceSide=new U(this),this.frontFace=new j(this),this.program=new $(this),this.activeTexture=new G(this),this.viewport=new q(this),this.bindFramebuffer=new Z(this),this.bindRenderbuffer=new W(this),this.bindTexture=new H(this),this.bindVertexBuffer=new X(this),this.bindElementBuffer=new Y(this),this.bindVertexArrayOES=new J(this),this.pixelStoreUnpack=new K(this),this.pixelStoreUnpackPremultiplyAlpha=new Q(this),this.pixelStoreUnpackFlipY=new ee(this),this.options=t?Object.assign({},t):{},this.options.extTextureFilterAnisotropicForceOff||(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.extDebugRendererInfo=e.getExtension("WEBGL_debug_renderer_info"),this.extDebugRendererInfo&&(this.renderer=e.getParameter(this.extDebugRendererInfo.UNMASKED_RENDERER_WEBGL),this.vendor=e.getParameter(this.extDebugRendererInfo.UNMASKED_VENDOR_WEBGL)),this.options.extTextureFloatLinearForceOff||(this.extTextureFloatLinear=e.getExtension("OES_texture_float_linear")),this.extRenderToTextureHalfFloat=e.getExtension("EXT_color_buffer_half_float"),this.extTimerQuery=e.getExtension("EXT_disjoint_timer_query_webgl2"),this.maxTextureSize=e.getParameter(e.MAX_TEXTURE_SIZE),this.maxPointSize=e.getParameter(e.ALIASED_POINT_SIZE_RANGE)[1]}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.bindVertexArrayOES.dirty=!0,this.pixelStoreUnpack.dirty=!0,this.pixelStoreUnpackPremultiplyAlpha.dirty=!0,this.pixelStoreUnpackFlipY.dirty=!0}createIndexBuffer(t,i,r){return new e.I(this,t,i,r)}createVertexBuffer(e,t,i,r,n){return new w(this,e,t,i,r,n)}createRenderbuffer(e,t,i){const r=this.gl,n=r.createRenderbuffer();return this.bindRenderbuffer.set(n),r.renderbufferStorage(r.RENDERBUFFER,e,t,i),this.bindRenderbuffer.set(null),n}createFramebuffer(e,t,i,r){return new se(this,e,t,i,r)}clear({color:e,depth:t,stencil:i,colorMask:r}){const n=this.gl;let o=0;e&&(o|=n.COLOR_BUFFER_BIT,this.clearColor.set(e),this.colorMask.set(r||[!0,!0,!0,!0])),void 0!==t&&(o|=n.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(t),this.depthMask.set(!0)),void 0!==i&&(o|=n.STENCIL_BUFFER_BIT,this.clearStencil.set(i),this.stencilMask.set(255)),n.clear(o)}setCullFace(e){!1===e.enable?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(t){e.d(t.blendFunction,e.a.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(t.blendFunction),this.blendColor.set(t.blendColor),t.blendEquation?this.blendEquation.set(t.blendEquation):this.blendEquation.setDefault()),this.colorMask.set(t.mask)}unbindVAO(){this.bindVertexArrayOES.set(null)}}class le{constructor(t,i,r,n){const o={width:r[0],height:r[1],data:null},s=t.gl;this.targetColorTexture=new e.T(t,o,s.RGBA,{useMipmap:!1}),this.backgroundColorTexture=new e.T(t,o,s.RGBA,{useMipmap:!1}),this.context=t,this.updateParticleTexture(i,n),this.lastInvalidatedAt=0}updateParticleTexture(t,i){if(this.particleTextureDimension===i.width)return;(this.particleTexture0||this.particleTexture1||this.particleIndexBuffer||this.particleSegment)&&(this.particleTexture0.destroy(),this.particleTexture1.destroy(),this.particleIndexBuffer.destroy(),this.particleSegment.destroy());const r=this.context.gl,n=i.width*i.height;this.particleTexture0=new e.T(this.context,i,r.RGBA,{premultiply:!1,useMipmap:!1}),this.particleTexture1=new e.T(this.context,i,r.RGBA,{premultiply:!1,useMipmap:!1});const o=new e.S;o.reserve(n);for(let e=0;e{if(!i)return;const r=e.c(i),n=new e.M(t,void 0,void 0,r);return n.computeBoundsAndApplyParent(),n})).catch((r=>{if(r&&404===r.status)return null;this.fire(new e.f(new Error(`Could not load model ${t} from ${i}: ${r.message}`)))}))}load(t,i){this.models[i]||(this.models[i]={});const r=Object.keys(t);this.numModelsLoading[i]=(this.numModelsLoading[i]||0)+r.length;const n=[];for(const e of r)n.push(this.loadModel(e,t[e]));Promise.allSettled(n).then((t=>{for(let e=0;e{this.fire(new e.f(new Error(`Could not load models: ${t.message}`)))}))}isLoaded(){for(const e in this.numModelsLoading)if(this.numModelsLoading[e]>0)return!1;return!0}hasModel(e,t){return!!this.getModel(e,t)}getModel(e,t){return this.models[t]||(this.models[t]={}),this.models[t][e]?this.models[t][e].model:void 0}addModel(e,t,i){this.models[i]||(this.models[i]={}),this.hasModel(e,i)&&this.models[i][e].numReferences++,this.load({[e]:this.requestManager.normalizeModelURL(t)},i)}addModels(e,t){this.models[t]||(this.models[t]={});const i={};for(const r in e)this.models[t][r]={},i[r]=this.requestManager.normalizeModelURL(e[r]);this.load(i,t)}addModelsFromBucket(e,t){this.models[t]||(this.models[t]={});const i={};for(const r of e)this.hasModel(r,t)?this.models[t][r].numReferences++:i[r]=this.requestManager.normalizeModelURL(r);this.load(i,t)}removeModel(e,t){if(this.models[t]&&this.models[t][e]&&(this.models[t][e].numReferences--,0===this.models[t][e].numReferences)){const i=this.models[t][e].model;delete this.models[t][e],i.destroy()}}listModels(e){return this.models[e]||(this.models[e]={}),Object.keys(this.models[e])}upload(e,t){this.models[t]||(this.models[t]={});for(const i in this.models[t])this.models[t][i].model&&this.models[t][i].model.upload(e.context)}}function he(e){const{userImage:t}=e;return!!(t&&t.render&&t.render())&&(e.data.replace(new Uint8Array(t.data.buffer)),!0)}class ue extends e.E{constructor(){super(),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded={},this.requestors=[],this.patterns={},this.atlasImage={},this.atlasTexture={},this.dirty=!0}createScope(t){this.images[t]={},this.loaded[t]=!1,this.updatedImages[t]={},this.patterns[t]={},this.callbackDispatchedThisFrame[t]={},this.atlasImage[t]=new e.j({width:1,height:1})}isLoaded(){for(const e in this.loaded)if(!this.loaded[e])return!1;return!0}setLoaded(e,t){if(this.loaded[t]!==e&&(this.loaded[t]=e,e)){for(const{ids:e,callback:i}of this.requestors)this._notify(e,t,i);this.requestors=[]}}hasImage(e,t){return!!this.getImage(e,t)}getImage(e,t){return this.images[t][e]}addImage(e,t,i){this._validate(e,i)&&(this.images[t][e]=i)}_validate(t,i){let r=!0;return this._validateStretch(i.stretchX,i.data&&i.data.width)||(this.fire(new e.f(new Error(`Image "${t}" has invalid "stretchX" value`))),r=!1),this._validateStretch(i.stretchY,i.data&&i.data.height)||(this.fire(new e.f(new Error(`Image "${t}" has invalid "stretchY" value`))),r=!1),this._validateContent(i.content,i)||(this.fire(new e.f(new Error(`Image "${t}" has invalid "content" value`))),r=!1),r}_validateStretch(e,t){if(!e)return!0;let i=0;for(const r of e){if(r[0]o)return[new e.V(i,r,`${r} is greater than the maximum value ${o}`)]}return[]}function me(t){const i=t.valueSpec,r=e.u(t.value.type);let n,o,s,a={};const l="categorical"!==r&&void 0===t.value.property,c=!l,h="array"===e.o(t.value.stops)&&"array"===e.o(t.value.stops[0])&&"object"===e.o(t.value.stops[0][0]),u=de({key:t.key,value:t.value,valueSpec:t.styleSpec.function,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{stops:function(t){if("identity"===r)return[new e.V(t.key,t.value,'identity function may not have a "stops" property')];let i=[];const n=t.value;return i=i.concat(pe({key:t.key,value:n,valueSpec:t.valueSpec,style:t.style,styleSpec:t.styleSpec,arrayElementValidator:d})),"array"===e.o(n)&&0===n.length&&i.push(new e.V(t.key,n,"array must have at least one stop")),i},default:function(e){return Le({key:e.key,value:e.value,valueSpec:i,style:e.style,styleSpec:e.styleSpec})}}});return"identity"===r&&l&&u.push(new e.V(t.key,t.value,'missing required property "property"')),"identity"===r||t.value.stops||u.push(new e.V(t.key,t.value,'missing required property "stops"')),"exponential"===r&&t.valueSpec.expression&&!e.s(t.valueSpec)&&u.push(new e.V(t.key,t.value,"exponential functions not supported")),t.styleSpec.$version>=8&&(c&&!e.r(t.valueSpec)?u.push(new e.V(t.key,t.value,"property functions not supported")):l&&!e.t(t.valueSpec)&&u.push(new e.V(t.key,t.value,"zoom functions not supported"))),"categorical"!==r&&!h||void 0!==t.value.property||u.push(new e.V(t.key,t.value,'"property" property is required')),u;function d(t){let r=[];const n=t.value,l=t.key;if("array"!==e.o(n))return[new e.V(l,n,`array expected, ${e.o(n)} found`)];if(2!==n.length)return[new e.V(l,n,`array length 2 expected, length ${n.length} found`)];if(h){if("object"!==e.o(n[0]))return[new e.V(l,n,`object expected, ${e.o(n[0])} found`)];if(void 0===n[0].zoom)return[new e.V(l,n,"object stop key must have zoom")];if(void 0===n[0].value)return[new e.V(l,n,"object stop key must have value")];const i=e.u(n[0].zoom);if("number"!=typeof i)return[new e.V(l,n[0].zoom,"stop zoom values must be numbers")];if(s&&s>i)return[new e.V(l,n[0].zoom,"stop zoom values must appear in ascending order")];i!==s&&(s=i,o=void 0,a={}),r=r.concat(de({key:`${l}[0]`,value:n[0],valueSpec:{zoom:{}},style:t.style,styleSpec:t.styleSpec,objectElementValidators:{zoom:fe,value:p}}))}else r=r.concat(p({key:`${l}[0]`,value:n[0],valueSpec:{},style:t.style,styleSpec:t.styleSpec},n));return e.v(e.x(n[1]))?r.concat([new e.V(`${l}[1]`,n[1],"expressions are not allowed in function stops.")]):r.concat(Le({key:`${l}[1]`,value:n[1],valueSpec:i,style:t.style,styleSpec:t.styleSpec}))}function p(t,s){const l=e.o(t.value),c=e.u(t.value),h=null!==t.value?t.value:s;if(n){if(l!==n)return[new e.V(t.key,h,`${l} stop domain type must match previous stop domain type ${n}`)]}else n=l;if("number"!==l&&"string"!==l&&"boolean"!==l&&"number"!=typeof c&&"string"!=typeof c&&"boolean"!=typeof c)return[new e.V(t.key,h,"stop domain value must be a number, string, or boolean")];if("number"!==l&&"categorical"!==r){let n=`number expected, ${l} found`;return e.r(i)&&void 0===r&&(n+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new e.V(t.key,h,n)]}return"categorical"!==r||"number"!==l||"number"==typeof c&&isFinite(c)&&Math.floor(c)===c?"categorical"!==r&&"number"===l&&"number"==typeof c&&"number"==typeof o&&void 0!==o&&cnew e.V(`${t.key}${i.key}`,t.value,i.message)));const r=i.value.expression||i.value._styleExpression.expression;if("property"===t.expressionContext&&"text-font"===t.propertyKey&&!r.outputDefined())return[new e.V(t.key,t.value,`Invalid data expression for "${t.propertyKey}". Output values must be contained as literals within the expression.`)];if("property"===t.expressionContext&&"layout"===t.propertyType&&!e.A(r))return[new e.V(t.key,t.value,'"feature-state" data expressions are not supported with layout properties.')];if("filter"===t.expressionContext)return ge(r,t);if(t.expressionContext&&0===t.expressionContext.indexOf("cluster")){if(!e.B(r,["zoom","feature-state"]))return[new e.V(t.key,t.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if("cluster-initial"===t.expressionContext&&!e.D(r))return[new e.V(t.key,t.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function ge(t,i){const r=new Set(["zoom","feature-state","pitch","distance-from-center"]);if(i.valueSpec&&i.valueSpec.expression)for(const e of i.valueSpec.expression.parameters)r.delete(e);if(0===r.size)return[];const n=[];return t instanceof e.F&&r.has(t.name)?[new e.V(i.key,i.value,`["${t.name}"] expression is not supported in a filter for a ${i.object.type} layer with id: ${i.object.id}`)]:(t.eachChild((e=>{n.push(...ge(e,i))})),n)}function ye(t){const i=t.key,r=t.value,n=t.valueSpec,o=[];return Array.isArray(n.values)?-1===n.values.indexOf(e.u(r))&&o.push(new e.V(i,r,`expected one of [${n.values.join(", ")}], ${JSON.stringify(r)} found`)):-1===Object.keys(n.values).indexOf(e.u(r))&&o.push(new e.V(i,r,`expected one of [${Object.keys(n.values).join(", ")}], ${JSON.stringify(r)} found`)),o}function xe(t){return e.H(e.x(t.value))?_e(e.q({},t,{expressionContext:"filter",valueSpec:t.styleSpec[`filter_${t.layerType||"fill"}`]})):ve(t)}function ve(t){const i=t.value,r=t.key;if("array"!==e.o(i))return[new e.V(r,i,`array expected, ${e.o(i)} found`)];const n=t.styleSpec;let o,s=[];if(i.length<1)return[new e.V(r,i,"filter array must have at least 1 element")];switch(s=s.concat(ye({key:`${r}[0]`,value:i[0],valueSpec:n.filter_operator,style:t.style,styleSpec:t.styleSpec})),e.u(i[0])){case"<":case"<=":case">":case">=":i.length>=2&&"$type"===e.u(i[1])&&s.push(new e.V(r,i,`"$type" cannot be use with operator "${i[0]}"`));case"==":case"!=":3!==i.length&&s.push(new e.V(r,i,`filter array for operator "${i[0]}" must have 3 elements`));case"in":case"!in":i.length>=2&&(o=e.o(i[1]),"string"!==o&&s.push(new e.V(`${r}[1]`,i[1],`string expected, ${o} found`)));for(let a=2;a{t in r&&i.push(new e.V(n,r[t],`"${t}" is prohibited for ref layers`))})),o.layers.forEach((i=>{e.u(i.id)===l&&(t=i)})),t?t.ref?i.push(new e.V(n,r.ref,"ref cannot reference another ref layer")):a=e.u(t.type):"string"==typeof l&&i.push(new e.V(n,r.ref,`ref layer "${l}" not found`))}else if("background"!==a&&"sky"!==a&&"slot"!==a)if(r.source){const t=o.sources&&o.sources[r.source],s=t&&e.u(t.type);t?"vector"===s&&"raster"===a?i.push(new e.V(n,r.source,`layer "${r.id}" requires a raster source`)):"raster"===s&&"raster"!==a?i.push(new e.V(n,r.source,`layer "${r.id}" requires a vector source`)):"vector"!==s||r["source-layer"]?"raster-dem"===s&&"hillshade"!==a?i.push(new e.V(n,r.source,"raster-dem source can only be used with layer type 'hillshade'.")):"raster-array"!==s||["raster","raster-particle"].includes(a)?"line"!==a||!r.paint||!r.paint["line-gradient"]&&!r.paint["line-trim-offset"]||"geojson"===s&&t.lineMetrics?"raster-particle"===a&&"raster-array"!==s&&i.push(new e.V(n,r.source,`layer "${r.id}" requires a 'raster-array' source.`)):i.push(new e.V(n,r,`layer "${r.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):i.push(new e.V(n,r.source,"raster-array source can only be used with layer type 'raster'.")):i.push(new e.V(n,r,`layer "${r.id}" must specify a "source-layer"`)):i.push(new e.V(n,r.source,`source "${r.source}" not found`))}else i.push(new e.V(n,r,'missing required property "source"'));return i=i.concat(de({key:n,value:r,valueSpec:s.layer,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":()=>[],type:()=>Le({key:`${n}.type`,value:r.type,valueSpec:s.layer.type,style:t.style,styleSpec:t.styleSpec,object:r,objectKey:"type"}),filter:t=>xe(e.q({layerType:a},t)),layout:t=>de({layer:r,key:t.key,value:t.value,valueSpec:{},style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":t=>Te(e.q({layerType:a},t))}}),paint:t=>de({layer:r,key:t.key,value:t.value,valueSpec:{},style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":t=>we(e.q({layerType:a,layer:r},t))}})}})),i}function Se(t){const i=t.value,r=t.key,n=e.o(i);return"string"!==n?[new e.V(r,i,`string expected, ${n} found`)]:[]}const Me={promoteId:function({key:t,value:i}){if("string"===e.o(i))return Se({key:t,value:i});{const e=[];for(const r in i)e.push(...Se({key:`${t}.${r}`,value:i[r]}));return e}}};function Ae(t){const i=t.value,r=t.key,n=t.styleSpec,o=t.style;if(!i.type)return[new e.V(r,i,'"type" is required')];const s=e.u(i.type);let a=[];switch(["vector","raster","raster-dem","raster-array"].includes(s)&&(i.url||i.tiles||a.push(new e.n(r,i,'Either "url" or "tiles" is required.'))),s){case"vector":case"raster":case"raster-dem":case"raster-array":return a=a.concat(de({key:r,value:i,valueSpec:n[`source_${s.replace("-","_")}`],style:t.style,styleSpec:n,objectElementValidators:Me})),a;case"geojson":if(a=de({key:r,value:i,valueSpec:n.source_geojson,style:o,styleSpec:n,objectElementValidators:Me}),i.cluster)for(const e in i.clusterProperties){const[t,n]=i.clusterProperties[e],o="string"==typeof t?[t,["accumulated"],["get",e]]:t;a.push(..._e({key:`${r}.${e}.map`,value:n,expressionContext:"cluster-map"})),a.push(..._e({key:`${r}.${e}.reduce`,value:o,expressionContext:"cluster-reduce"}))}return a;case"video":return de({key:r,value:i,valueSpec:n.source_video,style:o,styleSpec:n});case"image":return de({key:r,value:i,valueSpec:n.source_image,style:o,styleSpec:n});case"canvas":return[new e.V(r,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return ye({key:`${r}.type`,value:i.type,valueSpec:{values:Ie(n)},style:o,styleSpec:n})}}function Ie(e){return e.source.reduce(((t,i)=>{const r=e[i];return"enum"===r.type.type&&(t=t.concat(Object.keys(r.type.values))),t}),[])}function Ce(t){const i=t.value,r=t.styleSpec,n=r.light,o=t.style;let s=[];const a=e.o(i);if(void 0===i)return s;if("object"!==a)return s=s.concat([new e.V("light",i,`object expected, ${a} found`)]),s;for(const t in i){const a=t.match(/^(.*)-transition$/);s=s.concat(a&&n[a[1]]&&n[a[1]].transition?Le({key:t,value:i[t],valueSpec:r.transition,style:o,styleSpec:r}):n[t]?Le({key:t,value:i[t],valueSpec:n[t],style:o,styleSpec:r}):[new e.V(t,i[t],`unknown property "${t}"`)])}return s}function Pe(t){const i=t.value;let r=[];if(!i)return r;const n=e.o(i);if("object"!==n)return r=r.concat([new e.V("light-3d",i,`object expected, ${n} found`)]),r;const o=t.styleSpec,s=o["light-3d"],a=t.key,l=t.style,c=t.style.lights;for(const t of["type","id"])if(!(t in i))return r=r.concat([new e.V("light-3d",i,`missing property ${t} on light`)]),r;if(i.type&&c)for(let n=0;n[],array:pe,boolean:function(t){const i=t.value,r=t.key,n=e.o(i);return"boolean"!==n?[new e.V(r,i,`boolean expected, ${n} found`)]:[]},number:fe,color:function(t){const i=t.key,r=t.value,n=e.o(r);return"string"!==n?[new e.V(i,r,`color expected, ${n} found`)]:null===e.G(r)?[new e.V(i,r,`color expected, "${r}" found`)]:[]},enum:ye,filter:xe,function:me,layer:Ee,object:de,source:Ae,model:e.L,light:Ce,"light-3d":Pe,terrain:ze,fog:De,string:Se,formatted:function(e){return 0===Se(e).length?[]:_e(e)},resolvedImage:function(e){return 0===Se(e).length?[]:_e(e)},projection:function(t){const i=t.value,r=t.styleSpec,n=r.projection,o=t.style;let s=[];const a=e.o(i);if("object"===a)for(const e in i)s=s.concat(Le({key:e,value:i[e],valueSpec:n[e],style:o,styleSpec:r}));else"string"!==a&&(s=s.concat([new e.V("projection",i,`object or string expected, ${a} found`)]));return s},import:function(t){const{value:i,styleSpec:r}=t,{data:n}=i,o=a(i,l);Object.defineProperty(o,"__line__",{value:i.__line__,enumerable:!1});let s=de(e.q({},t,{value:o,valueSpec:r.import}));return""===e.u(o.id)&&s.push(new e.V(`${t.key}.id`,o,"import id can't be an empty string")),n&&(s=s.concat(Oe(n,r,{key:`${t.key}.data`}))),s}};function Le(t,i=!1){const r=t.value,n=t.valueSpec,o=t.styleSpec;if(n.expression&&e.J(e.u(r)))return me(t);if(n.expression&&e.v(e.x(r)))return _e(t);if(n.type&&Re[n.type]){const r=Re[n.type](t);return!0===i&&r.length>0&&"array"===e.o(t.value)?_e(t):r}return de(e.q({},t,{valueSpec:n.type?o[n.type]:n}))}function ke(t){const i=t.value,r=t.key,n=Se(t);return n.length||(-1===i.indexOf("{fontstack}")&&n.push(new e.V(r,i,'"glyphs" url must include a "{fontstack}" token')),-1===i.indexOf("{range}")&&n.push(new e.V(r,i,'"glyphs" url must include a "{range}" token'))),n}function Oe(t,i=e.N,r={}){return Le({key:r.key||"",value:t,valueSpec:i.$root,styleSpec:i,style:t,objectElementValidators:{glyphs:ke,"*":()=>[]}})}function Be(t,i=e.N){return He(Oe(t,i))}const Fe=e=>He(Ae(e)),Ne=e=>He(Ce(e)),Ve=e=>He(Pe(e)),Ue=e=>He(ze(e)),je=e=>He(De(e)),$e=e=>He(Ee(e)),Ge=e=>He(xe(e)),qe=e=>He(we(e)),Ze=e=>He(Te(e)),We=t=>He(e.L(t));function He(e){return e.slice().sort(((e,t)=>e.line&&t.line?e.line-t.line:0))}function Xe(t,i){let r=!1;if(i&&i.length)for(const n of i)n instanceof e.n?e.w(n.message):(t.fire(new e.f(new Error(n.message))),r=!0);return r}let Ye;class Je extends e.E{constructor(t,i="flat"){super(),this._transitionable=new e.O(Ye||(Ye=new e.U({anchor:new e.W(e.N.light.anchor),position:new e.X(e.N.light.position),color:new e.W(e.N.light.color),intensity:new e.W(e.N.light.intensity)}))),this.setLight(t,i),this._transitioning=this._transitionable.untransitioned()}getLight(){return this._transitionable.serialize()}setLight(e,t,i={}){this._validate(Ne,e,i)||(this._transitionable.setTransitionOrValue(e),this.id=t)}updateTransitions(e){this._transitioning=this._transitionable.transitioned(e,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(e){this.properties=this._transitioning.possiblyEvaluate(e)}_validate(t,i,r){return(!r||!1!==r.validate)&&Xe(this,t.call(Be,e.Q({value:i,style:{glyphs:!0,sprite:!0},styleSpec:e.N})))}}const Ke=new e.U({source:new e.W(e.N.terrain.source),exaggeration:new e.W(e.N.terrain.exaggeration)});let Qe=class extends e.E{constructor(t,i,r,n){super(),this.scope=r,this._transitionable=new e.O(Ke,r,n),this._transitionable.setTransitionOrValue(t,n),this._transitioning=this._transitionable.untransitioned(),this.drapeRenderMode=i}get(){return this._transitionable.serialize()}set(e,t){this._transitionable.setTransitionOrValue(e,t)}updateTransitions(e){this._transitioning=this._transitionable.transitioned(e,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(e){this.properties=this._transitioning.possiblyEvaluate(e)}getExaggeration(t){return this._transitioning.possiblyEvaluate(new e.Y(t)).get("exaggeration")}isZoomDependent(){const t=this._transitionable._values.exaggeration;return null!=t&&null!=t.value&&null!=t.value.expression&&t.value.expression instanceof e.Z}};const et=45,tt=65,it=.05;function rt(t,i,r,n){const o=e.a0(et,tt,r),[s,a]=nt(t,n);let l=1-Math.min(1,Math.exp((i-s)/(a-s)*-6));return l*=l*l,l=Math.min(1,1.00747*l),l*o*t.alpha}function nt(e,t){const i=.5/Math.tan(.5*t);return[e.range[0]+i,e.range[1]+i]}function ot(t,i,r,n,o){const s=e.$.transformMat4([],[i,r,n],o.mercatorFogMatrix);return rt(t,e.$.length(s),o.pitch,o._fov)}function st(t,i,r,n,o,s,a){const l=[[r,n,0],[o,n,0],[o,s,0],[r,s,0]];let c=Number.MAX_VALUE,h=-Number.MAX_VALUE;for(const t of l){const r=e.$.transformMat4([],t,i),n=e.$.length(r);c=Math.min(c,n),h=Math.max(h,n)}return[rt(t,c,a.pitch,a._fov),rt(t,h,a.pitch,a._fov)]}const at=new e.U({range:new e.W(e.N.fog.range),color:new e.W(e.N.fog.color),"high-color":new e.W(e.N.fog["high-color"]),"space-color":new e.W(e.N.fog["space-color"]),"horizon-blend":new e.W(e.N.fog["horizon-blend"]),"star-intensity":new e.W(e.N.fog["star-intensity"]),"vertical-range":new e.W(e.N.fog["vertical-range"])});class lt extends e.E{constructor(t,i,r,n){super(),this._transitionable=new e.O(at,r,new Map(n)),this.set(t,n),this._transitioning=this._transitionable.untransitioned(),this._transform=i,this.properties=new e.a1(at),this.scope=r}get state(){const t=this._transform,i="globe"===t.projection.name,r=e.a2(t.zoom),n=this.properties.get("range"),o=[.5,3];return{range:i?[e.a3(o[0],n[0],r),e.a3(o[1],n[1],r)]:n,horizonBlend:this.properties.get("horizon-blend"),alpha:this.properties.get("color").a}}get(){return this._transitionable.serialize()}set(t,i,r={}){if(this._validate(je,t,r))return;const n=e.Q({},t);for(const t of Object.keys(e.N.fog))void 0===n[t]&&(n[t]=e.N.fog[t].default);this._options=n,this._transitionable.setTransitionOrValue(this._options,i)}getOpacity(t){if(!this._transform.projection.supportsFog)return 0;const i=this.properties&&this.properties.get("color")||1;return("globe"===this._transform.projection.name?1:e.a0(et,tt,t))*i.a}getOpacityAtLatLng(t,i){return this._transform.projection.supportsFog?(function(t,i,r){const n=e._.fromLngLat(i),o=r.elevation?r.elevation.getAtPointOrZero(n):0;return ot(t,n.x,n.y,o,r)})(this.state,t,i):0}getOpacityForTile(t){if(!this._transform.projection.supportsFog)return[1,1];const i=this._transform.calculateFogTileMatrix(t.toUnwrapped());return st(this.state,i,0,0,e.a4,e.a4,this._transform)}getOpacityForBounds(e,t,i,r,n){return this._transform.projection.supportsFog?st(this.state,e,t,i,r,n,this._transform):[1,1]}getFovAdjustedRange(e){return this._transform.projection.supportsFog?nt(this.state,e):[0,1]}isVisibleOnFrustum(t){if(!this._transform.projection.supportsFog)return!1;const i=[4,5,6,7];for(const r of i){const i=t.points[r];let n;if(i[2]>=0)n=i;else{const o=t.points[r-4];n=e.a5(o,i,o[2]/(o[2]-i[2]))}if(ot(this.state,n[0],n[1],0,this._transform)>=it)return!0}return!1}updateConfig(e){this._transitionable.setTransitionOrValue(this._options,new Map(e))}updateTransitions(e){this._transitioning=this._transitionable.transitioned(e,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(e){this.properties=this._transitioning.possiblyEvaluate(e)}_validate(t,i,r){return(!r||!1!==r.validate)&&Xe(this,t.call(Be,e.Q({value:i,style:{glyphs:!0,sprite:!0},styleSpec:e.N})))}}class ct extends e.E{constructor(t,i,r,n){super(),this.scope=r,this._options=t,this.properties=new e.a1(i),this._transitionable=new e.O(i,r,new Map(n)),this._transitionable.setTransitionOrValue(t.properties),this._transitioning=this._transitionable.untransitioned()}updateConfig(e){this._transitionable.setTransitionOrValue(this._options.properties,new Map(e))}updateTransitions(e){this._transitioning=this._transitionable.transitioned(e,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(e){this.properties=this._transitioning.possiblyEvaluate(e)}get(){return this._options.properties=this._transitionable.serialize(),this._options}set(e,t){this._options=e,this._transitionable.setTransitionOrValue(e.properties,t)}shadowsEnabled(){return!!this.properties&&!0===this.properties.get("cast-shadows")}}let ht,ut;var dt="\n#define EPSILON 0.0000001\n#define PI 3.141592653589793\n#ifdef RENDER_CUTOFF\nfloat cutoff_opacity(vec4 cutoff_params,float depth) {float near=cutoff_params.x;float far=cutoff_params.y;float cutoffStart=cutoff_params.z;float cutoffEnd=cutoff_params.w;float linearDepth=(depth-near)/(far-near);return clamp((linearDepth-cutoffStart)/(cutoffEnd-cutoffStart),0.0,1.0);}\n#endif",pt="\nout vec4 glFragColor;highp float unpack_depth(highp vec4 rgba_depth)\n{const highp vec4 bit_shift=vec4(1.0/(255.0*255.0*255.0),1.0/(255.0*255.0),1.0/255.0,1.0);return dot(rgba_depth,bit_shift)*2.0-1.0;}highp vec4 pack_depth(highp float ndc_z) {highp float depth=ndc_z*0.5+0.5;const highp vec4 bit_shift=vec4(255.0*255.0*255.0,255.0*255.0,255.0,1.0);const highp vec4 bit_mask =vec4(0.0,1.0/255.0,1.0/255.0,1.0/255.0);highp vec4 res=fract(depth*bit_shift);res-=res.xxyz*bit_mask;return res;}\n#ifdef INDICATOR_CUTOUT\nuniform vec2 u_indicator_cutout_centers;uniform vec4 u_indicator_cutout_params;\n#endif\nvec4 applyCutout(vec4 color) {\n#ifdef INDICATOR_CUTOUT\nfloat holeMinOpacity=u_indicator_cutout_params.x;float holeRadius=max(u_indicator_cutout_params.y,0.0);float holeAspectRatio=u_indicator_cutout_params.z;float fadeStart=u_indicator_cutout_params.w;float distA=distance(vec2(gl_FragCoord.x,gl_FragCoord.y*holeAspectRatio),vec2(u_indicator_cutout_centers[0],u_indicator_cutout_centers[1]*holeAspectRatio));return color*min(smoothstep(fadeStart,holeRadius,distA)+holeMinOpacity,1.0);\n#else\nreturn color;\n#endif\n}\n#ifdef DEBUG_WIREFRAME\n#define HANDLE_WIREFRAME_DEBUG \\\nglFragColor=vec4(0.7,0.0,0.0,0.7); \\\ngl_FragDepth=gl_FragCoord.z-0.0001;\n#else\n#define HANDLE_WIREFRAME_DEBUG\n#endif\n#ifdef RENDER_CUTOFF\nuniform highp vec4 u_cutoff_params;in float v_cutoff_opacity;\n#endif\nvec4 textureLodCustom(sampler2D image,vec2 pos,vec2 lod_coord) {vec2 size=vec2(textureSize(image,0));vec2 dx=dFdx(lod_coord.xy*size);vec2 dy=dFdy(lod_coord.xy*size);float delta_max_sqr=max(dot(dx,dx),dot(dy,dy));float lod=0.5*log2(delta_max_sqr);return textureLod(image,pos,lod);}vec4 applyLUT(highp sampler3D lut,vec4 col) {vec3 size=vec3(textureSize(lut,0));vec3 uvw=(col.rbg*float(size-1.0)+0.5)/size;return vec4(texture(lut,uvw).rgb,col.a);}vec3 applyLUT(highp sampler3D lut,vec3 col) {return applyLUT(lut,vec4(col,1.0)).rgb;}",ft="\n#define EXTENT 8192.0\n#define RAD_TO_DEG 180.0/PI\n#define DEG_TO_RAD PI/180.0\n#define GLOBE_RADIUS EXTENT/PI/2.0\nfloat wrap(float n,float min,float max) {float d=max-min;float w=mod(mod(n-min,d)+d,d)+min;return (w==min) ? max : w;}\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 mercator_tile_position(mat4 matrix,vec2 tile_anchor,vec3 tile_id,vec2 mercator_center) {\n#ifndef PROJECTED_POS_ON_VIEWPORT\nfloat tiles=tile_id.z;vec2 mercator=(tile_anchor/EXTENT+tile_id.xy)/tiles;mercator-=mercator_center;mercator.x=wrap(mercator.x,-0.5,0.5);vec4 mercator_tile=vec4(mercator.xy*EXTENT,EXTENT/(2.0*PI),1.0);mercator_tile=matrix*mercator_tile;return mercator_tile.xyz;\n#else\nreturn vec3(0.0);\n#endif\n}vec3 mix_globe_mercator(vec3 globe,vec3 mercator,float t) {return mix(globe,mercator,t);}mat3 globe_mercator_surface_vectors(vec3 pos_normal,vec3 up_dir,float zoom_transition) {vec3 normal=zoom_transition==0.0 ? pos_normal : normalize(mix(pos_normal,up_dir,zoom_transition));vec3 xAxis=normalize(vec3(normal.z,0.0,-normal.x));vec3 yAxis=normalize(cross(normal,xAxis));return mat3(xAxis,yAxis,normal);}\n#endif\nvec2 unpack_float(const float packedValue) {int packedIntValue=int(packedValue);int v0=packedIntValue/256;return vec2(v0,packedIntValue-v0*256);}vec2 unpack_opacity(const float packedOpacity) {int intOpacity=int(packedOpacity)/2;return vec2(float(intOpacity)/127.0,mod(packedOpacity,2.0));}vec4 decode_color(const vec2 encodedColor) {return vec4(\nunpack_float(encodedColor[0])/255.0,unpack_float(encodedColor[1])/255.0\n);}float unpack_mix_vec2(const vec2 packedValue,const float t) {return mix(packedValue[0],packedValue[1],t);}vec4 unpack_mix_color(const vec4 packedColors,const float t) {vec4 minColor=decode_color(vec2(packedColors[0],packedColors[1]));vec4 maxColor=decode_color(vec2(packedColors[2],packedColors[3]));return mix(minColor,maxColor,t);}vec2 get_pattern_pos(const vec2 pixel_coord_upper,const vec2 pixel_coord_lower,const vec2 pattern_size,const float tile_units_to_pixels,const vec2 pos) {vec2 offset=mod(mod(mod(pixel_coord_upper,pattern_size)*256.0,pattern_size)*256.0+pixel_coord_lower,pattern_size);return (tile_units_to_pixels*pos+offset)/pattern_size;}float mercatorXfromLng(float lng) {return (180.0+lng)/360.0;}float mercatorYfromLat(float lat) {return (180.0-(RAD_TO_DEG*log(tan(PI/4.0+lat/2.0*DEG_TO_RAD))))/360.0;}vec3 latLngToECEF(vec2 latLng) {latLng=DEG_TO_RAD*latLng;float cosLat=cos(latLng[0]);float sinLat=sin(latLng[0]);float cosLng=cos(latLng[1]);float sinLng=sin(latLng[1]);float sx=cosLat*sinLng*GLOBE_RADIUS;float sy=-sinLat*GLOBE_RADIUS;float sz=cosLat*cosLng*GLOBE_RADIUS;return vec3(sx,sy,sz);}\n#ifdef RENDER_CUTOFF\nuniform vec4 u_cutoff_params;out float v_cutoff_opacity;\n#endif\nconst vec4 AWAY=vec4(-1000.0,-1000.0,-1000.0,1);const float skirtOffset=24575.0;vec3 decomposeToPosAndSkirt(vec2 posWithComposedSkirt)\n{float skirt=float(posWithComposedSkirt.x >=skirtOffset);vec2 pos=posWithComposedSkirt-vec2(skirt*skirtOffset,0.0);return vec3(pos,skirt);}",mt="in highp vec3 a_pos_3f;uniform lowp mat4 u_matrix;out highp vec3 v_uv;void main() {const mat3 half_neg_pi_around_x=mat3(1.0,0.0, 0.0,0.0,0.0,-1.0,0.0,1.0, 0.0);v_uv=half_neg_pi_around_x*a_pos_3f;vec4 pos=u_matrix*vec4(a_pos_3f,1.0);gl_Position=pos.xyww;}",_t="\n#define ELEVATION_SCALE 7.0\n#define ELEVATION_OFFSET 450.0\n#ifdef PROJECTION_GLOBE_VIEW\nuniform vec3 u_tile_tl_up;uniform vec3 u_tile_tr_up;uniform vec3 u_tile_br_up;uniform vec3 u_tile_bl_up;uniform float u_tile_up_scale;vec3 elevationVector(vec2 pos) {vec2 uv=pos/EXTENT;vec3 up=normalize(mix(\nmix(u_tile_tl_up,u_tile_tr_up,uv.xxx),mix(u_tile_bl_up,u_tile_br_up,uv.xxx),uv.yyy));return up*u_tile_up_scale;}\n#else\nvec3 elevationVector(vec2 pos) { return vec3(0,0,1); }\n#endif\n#ifdef TERRAIN\nuniform highp sampler2D u_dem;uniform highp sampler2D u_dem_prev;uniform vec2 u_dem_tl;uniform vec2 u_dem_tl_prev;uniform float u_dem_scale;uniform float u_dem_scale_prev;uniform float u_dem_size;uniform float u_dem_lerp;uniform float u_exaggeration;uniform float u_meter_to_dem;uniform mat4 u_label_plane_matrix_inv;vec4 tileUvToDemSample(vec2 uv,float dem_size,float dem_scale,vec2 dem_tl) {vec2 pos=dem_size*(uv*dem_scale+dem_tl)+1.0;vec2 f=fract(pos);return vec4((pos-f+0.5)/(dem_size+2.0),f);}float currentElevation(vec2 apos) {\n#ifdef TERRAIN_DEM_FLOAT_FORMAT\nvec2 pos=(u_dem_size*(apos/8192.0*u_dem_scale+u_dem_tl)+1.5)/(u_dem_size+2.0);return u_exaggeration*texture(u_dem,pos).r;\n#else\nfloat dd=1.0/(u_dem_size+2.0);vec4 r=tileUvToDemSample(apos/8192.0,u_dem_size,u_dem_scale,u_dem_tl);vec2 pos=r.xy;vec2 f=r.zw;float tl=texture(u_dem,pos).r;float tr=texture(u_dem,pos+vec2(dd,0)).r;float bl=texture(u_dem,pos+vec2(0,dd)).r;float br=texture(u_dem,pos+vec2(dd,dd)).r;return u_exaggeration*mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);\n#endif\n}float prevElevation(vec2 apos) {\n#ifdef TERRAIN_DEM_FLOAT_FORMAT\nvec2 pos=(u_dem_size*(apos/8192.0*u_dem_scale_prev+u_dem_tl_prev)+1.5)/(u_dem_size+2.0);return u_exaggeration*texture(u_dem_prev,pos).r;\n#else\nfloat dd=1.0/(u_dem_size+2.0);vec4 r=tileUvToDemSample(apos/8192.0,u_dem_size,u_dem_scale_prev,u_dem_tl_prev);vec2 pos=r.xy;vec2 f=r.zw;float tl=texture(u_dem_prev,pos).r;float tr=texture(u_dem_prev,pos+vec2(dd,0)).r;float bl=texture(u_dem_prev,pos+vec2(0,dd)).r;float br=texture(u_dem_prev,pos+vec2(dd,dd)).r;return u_exaggeration*mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);\n#endif\n}\n#ifdef TERRAIN_VERTEX_MORPHING\nfloat elevation(vec2 apos) {\n#ifdef ZERO_EXAGGERATION\nreturn 0.0;\n#endif\nfloat nextElevation=currentElevation(apos);float prevElevation=prevElevation(apos);return mix(prevElevation,nextElevation,u_dem_lerp);}\n#else\nfloat elevation(vec2 apos) {\n#ifdef ZERO_EXAGGERATION\nreturn 0.0;\n#endif\nreturn currentElevation(apos);}\n#endif\nvec4 fourSample(vec2 pos,vec2 off) {float tl=texture(u_dem,pos).r;float tr=texture(u_dem,pos+vec2(off.x,0.0)).r;float bl=texture(u_dem,pos+vec2(0.0,off.y)).r;float br=texture(u_dem,pos+off).r;return vec4(tl,tr,bl,br);}float flatElevation(vec2 pack) {vec2 apos=floor(pack/8.0);vec2 span=10.0*(pack-apos*8.0);vec2 uvTex=(apos-vec2(1.0,1.0))/8190.0;float size=u_dem_size+2.0;float dd=1.0/size;vec2 pos=u_dem_size*(uvTex*u_dem_scale+u_dem_tl)+1.0;vec2 f=fract(pos);pos=(pos-f+0.5)*dd;vec4 h=fourSample(pos,vec2(dd));float z=mix(mix(h.x,h.y,f.x),mix(h.z,h.w,f.x),f.y);vec2 w=floor(0.5*(span*u_meter_to_dem-1.0));vec2 d=dd*w;h=fourSample(pos-d,2.0*d+vec2(dd));vec4 diff=abs(h.xzxy-h.ywzw);vec2 slope=min(vec2(0.25),u_meter_to_dem*0.5*(diff.xz+diff.yw)/(2.0*w+vec2(1.0)));vec2 fix=slope*span;float base=z+max(fix.x,fix.y);return u_exaggeration*base;}float elevationFromUint16(float word) {return u_exaggeration*(word/ELEVATION_SCALE-ELEVATION_OFFSET);}\n#else\nfloat elevation(vec2 pos) { return 0.0; }\n#endif\n#ifdef DEPTH_OCCLUSION\nuniform highp sampler2D u_depth;uniform highp vec2 u_depth_size_inv;uniform highp vec2 u_depth_range_unpack;uniform highp float u_occluder_half_size;uniform highp float u_occlusion_depth_offset;\n#ifdef DEPTH_D24\nfloat unpack_depth(float depth) {return depth*u_depth_range_unpack.x+u_depth_range_unpack.y;}vec4 unpack_depth4(vec4 depth) {return depth*u_depth_range_unpack.x+vec4(u_depth_range_unpack.y);}\n#else\nhighp float unpack_depth_rgba(vec4 rgba_depth)\n{const highp vec4 bit_shift=vec4(1.0/(255.0*255.0*255.0),1.0/(255.0*255.0),1.0/255.0,1.0);return dot(rgba_depth,bit_shift)*2.0-1.0;}\n#endif\nbool isOccluded(vec4 frag) {vec3 coord=frag.xyz/frag.w;\n#ifdef DEPTH_D24\nfloat depth=unpack_depth(texture(u_depth,(coord.xy+1.0)*0.5).r);\n#else\nfloat depth=unpack_depth_rgba(texture(u_depth,(coord.xy+1.0)*0.5));\n#endif\nreturn coord.z+u_occlusion_depth_offset > depth;}highp vec4 getCornerDepths(vec2 coord) {highp vec3 df=vec3(u_occluder_half_size*u_depth_size_inv,0.0);highp vec2 uv=0.5*coord.xy+0.5;\n#ifdef DEPTH_D24\nhighp vec4 depth=vec4(\ntexture(u_depth,uv-df.xz).r,texture(u_depth,uv+df.xz).r,texture(u_depth,uv-df.zy).r,texture(u_depth,uv+df.zy).r\n);depth=unpack_depth4(depth);\n#else\nhighp vec4 depth=vec4(\nunpack_depth_rgba(texture(u_depth,uv-df.xz)),unpack_depth_rgba(texture(u_depth,uv+df.xz)),unpack_depth_rgba(texture(u_depth,uv-df.zy)),unpack_depth_rgba(texture(u_depth,uv+df.zy))\n);\n#endif\nreturn depth;}highp float occlusionFadeMultiSample(vec4 frag) {highp vec3 coord=frag.xyz/frag.w;highp vec2 uv=0.5*coord.xy+0.5;int NX=3;int NY=4;highp vec2 df=u_occluder_half_size*u_depth_size_inv;highp vec2 oneStep=2.0*u_occluder_half_size*u_depth_size_inv/vec2(NX-1,NY-1);highp float res=0.0;for (int y=0; y < NY;++y) {for (int x=0; x < NX;++x) {\n#ifdef DEPTH_D24\nhighp float depth=unpack_depth(texture(u_depth,uv-df+vec2(float(x)*oneStep.x,float(y)*oneStep.y)).r);\n#else\nhighp float depth=unpack_depth_rgba(texture(u_depth,uv-df+vec2(float(x)*oneStep.x,float(y)*oneStep.y)));\n#endif\nres+=1.0-clamp(300.0*(coord.z+u_occlusion_depth_offset-depth),0.0,1.0);}}res=clamp(2.0*res/float(NX*NY)-0.5,0.0,1.0);return res;}highp float occlusionFade(vec4 frag) {highp vec3 coord=frag.xyz/frag.w;highp vec4 depth=getCornerDepths(coord.xy);return dot(vec4(0.25),vec4(1.0)-clamp(300.0*(vec4(coord.z+u_occlusion_depth_offset)-depth),0.0,1.0));}\n#else\nbool isOccluded(vec4 frag) { return false; }highp float occlusionFade(vec4 frag) { return 1.0; }highp float occlusionFadeMultiSample(vec4 frag) { return 1.0; }\n#endif//DEPTH_OCCLUSION",gt="#ifdef FOG\nuniform mediump vec4 u_fog_color;uniform mediump vec2 u_fog_range;uniform mediump float u_fog_horizon_blend;uniform mediump mat4 u_fog_matrix;out vec3 v_fog_pos;float fog_range(float depth) {return (depth-u_fog_range[0])/(u_fog_range[1]-u_fog_range[0]);}float fog_horizon_blending(vec3 camera_dir) {float t=max(0.0,camera_dir.z/u_fog_horizon_blend);return u_fog_color.a*exp(-3.0*t*t);}float fog_opacity(float t) {const float decay=6.0;float falloff=1.0-min(1.0,exp(-decay*t));falloff*=falloff*falloff;return u_fog_color.a*min(1.0,1.00747*falloff);}vec3 fog_position(vec3 pos) {return (u_fog_matrix*vec4(pos,1.0)).xyz;}vec3 fog_position(vec2 pos) {return fog_position(vec3(pos,0.0));}float fog(vec3 pos) {float depth=length(pos);float opacity=fog_opacity(fog_range(depth));return opacity*fog_horizon_blending(pos/depth);}\n#endif",yt="highp vec3 hash(highp vec2 p) {highp vec3 p3=fract(p.xyx*vec3(443.8975,397.2973,491.1871));p3+=dot(p3,p3.yxz+19.19);return fract((p3.xxy+p3.yzz)*p3.zyx);}vec3 dither(vec3 color,highp vec2 seed) {vec3 rnd=hash(seed)+hash(seed+0.59374)-0.5;return color+rnd/255.0;}\n#ifdef FOG\nuniform mediump vec4 u_fog_color;uniform mediump vec2 u_fog_range;uniform mediump float u_fog_horizon_blend;uniform mediump vec2 u_fog_vertical_limit;uniform mediump float u_fog_temporal_offset;in vec3 v_fog_pos;uniform highp vec3 u_frustum_tl;uniform highp vec3 u_frustum_tr;uniform highp vec3 u_frustum_br;uniform highp vec3 u_frustum_bl;uniform highp vec3 u_globe_pos;uniform highp float u_globe_radius;uniform highp vec2 u_viewport;uniform float u_globe_transition;uniform int u_is_globe;float fog_range(float depth) {return (depth-u_fog_range[0])/(u_fog_range[1]-u_fog_range[0]);}float fog_horizon_blending(vec3 camera_dir) {float t=max(0.0,camera_dir.z/u_fog_horizon_blend);return u_fog_color.a*exp(-3.0*t*t);}float fog_opacity(float t) {const float decay=6.0;float falloff=1.0-min(1.0,exp(-decay*t));falloff*=falloff*falloff;return u_fog_color.a*min(1.0,1.00747*falloff);}float globe_glow_progress() {highp vec2 uv=gl_FragCoord.xy/u_viewport;highp vec3 ray_dir=mix(\nmix(u_frustum_tl,u_frustum_tr,uv.x),mix(u_frustum_bl,u_frustum_br,uv.x),1.0-uv.y);highp vec3 dir=normalize(ray_dir);highp vec3 closest_point=dot(u_globe_pos,dir)*dir;highp float sdf=length(closest_point-u_globe_pos)/u_globe_radius;return sdf+PI*0.5;}float fog_opacity(vec3 pos) {float depth=length(pos);return fog_opacity(fog_range(depth));}vec3 fog_apply(vec3 color,vec3 pos,float opacity_limit) {float depth=length(pos);float opacity;if (u_is_globe==1) {float glow_progress=globe_glow_progress();float t=mix(glow_progress,depth,u_globe_transition);opacity=fog_opacity(fog_range(t));} else {opacity=fog_opacity(fog_range(depth));opacity*=fog_horizon_blending(pos/depth);}return mix(color,u_fog_color.rgb,min(opacity,opacity_limit));}vec3 fog_apply(vec3 color,vec3 pos) {return fog_apply(color,pos,1.0);}vec4 fog_apply_from_vert(vec4 color,float fog_opac) {float alpha=EPSILON+color.a;color.rgb=mix(color.rgb/alpha,u_fog_color.rgb,fog_opac)*alpha;return color;}vec3 fog_apply_sky_gradient(vec3 camera_ray,vec3 sky_color) {float horizon_blend=fog_horizon_blending(normalize(camera_ray));return mix(sky_color,u_fog_color.rgb,horizon_blend);}vec4 fog_apply_premultiplied(vec4 color,vec3 pos) {float alpha=EPSILON+color.a;color.rgb=fog_apply(color.rgb/alpha,pos)*alpha;return color;}vec4 fog_apply_premultiplied(vec4 color,vec3 pos,float heightMeters) {float verticalProgress=(u_fog_vertical_limit.x > 0.0 || u_fog_vertical_limit.y > 0.0) ? smoothstep(u_fog_vertical_limit.x,u_fog_vertical_limit.y,heightMeters) : 0.0;float opacityLimit=1.0-smoothstep(0.9,1.0,fog_opacity(pos));return mix(fog_apply_premultiplied(color,pos),color,min(verticalProgress,opacityLimit));}vec3 fog_dither(vec3 color) {\n#ifdef FOG_DITHERING\nvec2 dither_seed=gl_FragCoord.xy+u_fog_temporal_offset;return dither(color,dither_seed);\n#else\nreturn color;\n#endif\n}vec4 fog_dither(vec4 color) {return vec4(fog_dither(color.rgb),color.a);}\n#endif",xt="#ifdef RASTER_ARRAY\nuniform sampler2D u_image0;uniform sampler2D u_image1;const vec4 NODATA=vec4(1);ivec4 _raTexLinearCoord(highp vec2 texCoord,highp vec2 texResolution,out highp vec2 fxy) {texCoord=texCoord*texResolution-0.5;fxy=fract(texCoord);texCoord-=fxy;return ivec4(texCoord.xxyy+vec2(1.5,0.5).xyxy);}vec2 _raTexLinearMix(highp vec2 fxy,highp vec4 colorMix,highp float colorOffset,highp vec4 t00,highp vec4 t10,highp vec4 t01,highp vec4 t11) {vec2 c00=t00==NODATA ? vec2(0) : vec2(colorOffset+dot(t00,colorMix),1);vec2 c10=t10==NODATA ? vec2(0) : vec2(colorOffset+dot(t10,colorMix),1);vec2 c01=t01==NODATA ? vec2(0) : vec2(colorOffset+dot(t01,colorMix),1);vec2 c11=t11==NODATA ? vec2(0) : vec2(colorOffset+dot(t11,colorMix),1);return mix(mix(c01,c11,fxy.x),mix(c00,c10,fxy.x),fxy.y);}vec2 raTexture2D_image0_linear(highp vec2 texCoord,highp vec2 texResolution,highp vec4 colorMix,highp float colorOffset) {vec2 fxy;ivec4 c=_raTexLinearCoord(texCoord,texResolution,fxy);return _raTexLinearMix(fxy,colorMix,colorOffset,texelFetch(u_image0,c.yz,0),texelFetch(u_image0,c.xz,0),texelFetch(u_image0,c.yw,0),texelFetch(u_image0,c.xw,0)\n);}vec2 raTexture2D_image1_linear(highp vec2 texCoord,highp vec2 texResolution,highp vec4 colorMix,highp float colorOffset) {vec2 fxy;ivec4 c=_raTexLinearCoord(texCoord,texResolution,fxy);return _raTexLinearMix(fxy,colorMix,colorOffset,texelFetch(u_image1,c.yz,0),texelFetch(u_image1,c.xz,0),texelFetch(u_image1,c.yw,0),texelFetch(u_image1,c.xw,0)\n);}vec2 raTexture2D_image0_nearest(highp vec2 texCoord,highp vec2 texResolution,highp vec4 colorMix,highp float colorOffset) {vec4 t=texelFetch(u_image0,ivec2(texCoord*texResolution),0);return t==NODATA ? vec2(0) : vec2(colorOffset+dot(t,colorMix),1);}vec2 raTexture2D_image1_nearest(highp vec2 texCoord,highp vec2 texResolution,highp vec4 colorMix,highp float colorOffset) {vec4 t=texelFetch(u_image1,ivec2(texCoord*texResolution),0);return t==NODATA ? vec2(0) : vec2(colorOffset+dot(t,colorMix),1);}\n#endif",vt="#ifdef RASTER_ARRAY\nuniform sampler2D u_velocity;uniform mediump vec2 u_velocity_res;uniform mediump float u_max_speed;const vec4 NO_DATA=vec4(1);const vec2 INVALID_VELOCITY=vec2(-1);uniform highp vec2 u_uv_offset;uniform highp float u_data_offset;uniform highp vec2 u_data_scale;ivec4 rasterArrayLinearCoord(highp vec2 texCoord,highp vec2 texResolution,out highp vec2 fxy) {texCoord=texCoord*texResolution-0.5;fxy=fract(texCoord);texCoord-=fxy;return ivec4(texCoord.xxyy+vec2(1.5,0.5).xyxy);}highp vec2 lookup_velocity(highp vec2 uv) {uv=u_uv_offset.x+u_uv_offset.y*uv;highp vec2 fxy;ivec4 c=rasterArrayLinearCoord(uv,u_velocity_res,fxy);highp vec4 tl=texelFetch(u_velocity,c.yz,0);highp vec4 tr=texelFetch(u_velocity,c.xz,0);highp vec4 bl=texelFetch(u_velocity,c.yw,0);highp vec4 br=texelFetch(u_velocity,c.xw,0);if (tl==NO_DATA) {return INVALID_VELOCITY;}if (tr==NO_DATA) {return INVALID_VELOCITY;}if (bl==NO_DATA) {return INVALID_VELOCITY;}if (br==NO_DATA) {return INVALID_VELOCITY;}highp vec4 t=mix(mix(bl,br,fxy.x),mix(tl,tr,fxy.x),fxy.y);highp vec2 velocity=u_data_offset+vec2(dot(t.rg,u_data_scale),dot(t.ba,u_data_scale));velocity.y=-velocity.y;velocity/=max(u_max_speed,length(velocity));return velocity;}\n#endif\nuniform highp float u_particle_pos_scale;uniform highp vec2 u_particle_pos_offset;highp vec4 pack_pos_to_rgba(highp vec2 p) {highp vec2 v=(p+u_particle_pos_offset)/u_particle_pos_scale;highp vec4 r=vec4(v.x,fract(v.x*255.0),v.y,fract(v.y*255.0));return vec4(r.x-r.y/255.0,r.y,r.z-r.w/255.0,r.w);}highp vec2 unpack_pos_from_rgba(highp vec4 v) {v=floor(v*255.0+0.5)/255.0;highp vec2 p=vec2(v.x+(v.y/255.0),v.z+(v.w/255.0));return u_particle_pos_scale*p-u_particle_pos_offset;}",bt="#ifdef RENDER_SHADOWS\nuniform mediump vec3 u_shadow_direction;uniform highp vec3 u_shadow_normal_offset;vec3 shadow_normal_offset(vec3 normal) {float tileInMeters=u_shadow_normal_offset[0];vec3 n=vec3(-normal.xy,tileInMeters*normal.z);float dotScale=min(1.0-dot(normal,u_shadow_direction),1.0)*0.5+0.5;return n*dotScale;}vec3 shadow_normal_offset_model(vec3 normal) {vec3 transformed_normal=vec3(-normal.xy,normal.z);float NDotL=dot(normalize(transformed_normal),u_shadow_direction);float dotScale=min(1.0-NDotL,1.0)*0.5+0.5;return normal*dotScale;}float shadow_normal_offset_multiplier0() {return u_shadow_normal_offset[1];}float shadow_normal_offset_multiplier1() {return u_shadow_normal_offset[2];}\n#endif//RENDER_SHADOWS",wt="#ifdef RENDER_SHADOWS\n#ifdef DEPTH_TEXTURE\nuniform highp sampler2D u_shadowmap_0;uniform highp sampler2D u_shadowmap_1;\n#else\nuniform sampler2D u_shadowmap_0;uniform sampler2D u_shadowmap_1;\n#endif\nuniform float u_shadow_intensity;uniform float u_shadow_map_resolution;uniform float u_shadow_texel_size;uniform highp vec3 u_shadow_normal_offset;uniform vec2 u_fade_range;uniform mediump vec3 u_shadow_direction;uniform highp vec3 u_shadow_bias;highp float shadow_sample_1(highp vec2 uv,highp float compare) {highp float shadow_depth;\n#ifdef DEPTH_TEXTURE\nshadow_depth=texture(u_shadowmap_1,uv).r;\n#else\nshadow_depth=unpack_depth(texture(u_shadowmap_1,uv))*0.5+0.5;\n#endif\nreturn step(shadow_depth,compare);}highp float shadow_sample_0(highp vec2 uv,highp float compare) {highp float shadow_depth;\n#ifdef DEPTH_TEXTURE\nshadow_depth=texture(u_shadowmap_0,uv).r;\n#else\nshadow_depth=unpack_depth(texture(u_shadowmap_0,uv))*0.5+0.5;\n#endif\nreturn step(shadow_depth,compare);}float shadow_occlusion_1(highp vec4 pos,highp float bias) {highp vec2 uv=pos.xy;return shadow_sample_1(uv,pos.z-bias);}float shadow_occlusion_0(highp vec4 pos,highp float bias) {highp float compare0=pos.z-bias;\n#ifdef NATIVE\nhighp vec2 uv=pos.xy;highp vec4 samples=textureGather(u_shadowmap_0,uv,0);lowp vec4 stepSamples=step(samples,vec4(compare0));\n#else\nhighp vec2 uv00=pos.xy-vec2(0.5*u_shadow_texel_size);highp vec2 uv10=uv00+vec2(u_shadow_texel_size,0.0);highp vec2 uv01=uv00+vec2(0.0,u_shadow_texel_size);highp vec2 uv11=uv01+vec2(u_shadow_texel_size,0.0);lowp vec4 stepSamples=vec4(\nshadow_sample_0(uv01,compare0),shadow_sample_0(uv11,compare0),shadow_sample_0(uv10,compare0),shadow_sample_0(uv00,compare0)\n);\n#endif\nvec2 f=fract(pos.xy*u_shadow_map_resolution-vec2(0.5));lowp vec2 lerpx=mix(stepSamples.wx,stepSamples.zy,f.xx);return mix(lerpx.x,lerpx.y,f.y);}float shadow_occlusion(highp vec4 light_view_pos0,highp vec4 light_view_pos1,float view_depth,highp float bias) {\n#ifdef SHADOWS_SINGLE_CASCADE\nlight_view_pos0.xyz=light_view_pos0.xyz/light_view_pos0.w*0.5+0.5;return shadow_occlusion_0(light_view_pos0,bias);\n#else\nlight_view_pos0.xyz/=light_view_pos0.w;light_view_pos1.xyz/=light_view_pos1.w;vec4 uv=vec4(light_view_pos0.xy,light_view_pos1.xy);vec4 abs_bounds=abs(uv);if (abs_bounds.x < 1.0 && abs_bounds.y < 1.0) {light_view_pos0.xyz=light_view_pos0.xyz*0.5+0.5;return shadow_occlusion_0(light_view_pos0,bias);}if (abs_bounds.z >=1.0 || abs_bounds.w >=1.0) {return 0.0;}light_view_pos1.xyz=light_view_pos1.xyz*0.5+0.5;float occlusion1=shadow_occlusion_1(light_view_pos1,bias);return mix(occlusion1,0.0,smoothstep(u_fade_range.x,u_fade_range.y,view_depth));\n#endif\n}highp float calculate_shadow_bias(float NDotL) {\n#ifdef NORMAL_OFFSET\nreturn 0.5*u_shadow_bias.x;\n#else\nreturn 0.5*(u_shadow_bias.x+clamp(u_shadow_bias.y*tan(acos(NDotL)),0.0,u_shadow_bias.z));\n#endif\n}float shadowed_light_factor_normal(vec3 N,highp vec4 light_view_pos0,highp vec4 light_view_pos1,float view_depth) {float NDotL=dot(N,u_shadow_direction);float bias=calculate_shadow_bias(NDotL);float occlusion=shadow_occlusion(light_view_pos0,light_view_pos1,view_depth,bias);return mix(0.0,(1.0-(u_shadow_intensity*occlusion))*NDotL,step(0.0,NDotL));}float shadowed_light_factor_normal_opacity(vec3 N,highp vec4 light_view_pos0,highp vec4 light_view_pos1,float view_depth,float shadow_opacity) {float NDotL=dot(N,u_shadow_direction);float bias=calculate_shadow_bias(NDotL);float occlusion=shadow_occlusion(light_view_pos0,light_view_pos1,view_depth,bias)*shadow_opacity;return mix(0.0,(1.0-(u_shadow_intensity*occlusion))*NDotL,step(0.0,NDotL));}float shadowed_light_factor_normal_unbiased(vec3 N,highp vec4 light_view_pos0,highp vec4 light_view_pos1,float view_depth) {float NDotL=dot(N,u_shadow_direction);float bias=0.0;float occlusion=shadow_occlusion(light_view_pos0,light_view_pos1,view_depth,bias);return mix(0.0,(1.0-(u_shadow_intensity*occlusion))*NDotL,step(0.0,NDotL));}float shadowed_light_factor(highp vec4 light_view_pos0,highp vec4 light_view_pos1,float view_depth) {float bias=0.0;float occlusion=shadow_occlusion(light_view_pos0,light_view_pos1,view_depth,bias);return 1.0-(u_shadow_intensity*occlusion);}float shadow_occlusion(float ndotl,highp vec4 light_view_pos0,highp vec4 light_view_pos1,float view_depth) {float bias=calculate_shadow_bias(ndotl);return shadow_occlusion(light_view_pos0,light_view_pos1,view_depth,bias);}\n#endif";const Tt=[];Ct(dt,Tt),Ct(ft,Tt),Ct(pt,Tt);const Et={"_prelude_fog.vertex.glsl":gt,"_prelude_terrain.vertex.glsl":_t,"_prelude_shadow.vertex.glsl":bt,"_prelude_fog.fragment.glsl":yt,"_prelude_shadow.fragment.glsl":wt,"_prelude_lighting.glsl":"\n#ifdef LIGHTING_3D_MODE\nuniform mediump vec3 u_lighting_ambient_color;uniform mediump vec3 u_lighting_directional_dir;uniform mediump vec3 u_lighting_directional_color;uniform mediump vec3 u_ground_radiance;float calculate_ambient_directional_factor(vec3 normal) {float NdotL=dot(normal,u_lighting_directional_dir);const float factor_reduction_max=0.3;float dir_luminance=dot(u_lighting_directional_color,vec3(0.2126,0.7152,0.0722));float directional_factor_min=1.0-factor_reduction_max*min(dir_luminance,1.0);float ambient_directional_factor=mix(directional_factor_min,1.0,min((NdotL+1.0),1.0));const float vertical_factor_min=0.92;float vertical_factor=mix(vertical_factor_min,1.0,normal.z*0.5+0.5);return vertical_factor*ambient_directional_factor;}vec3 linearProduct(vec3 srgbIn,vec3 k) {return srgbIn*pow(k,vec3(1./2.2));}vec3 apply_lighting(vec3 color,vec3 normal,float dir_factor) {float ambient_directional_factor=calculate_ambient_directional_factor(normal);vec3 ambient_contrib=ambient_directional_factor*u_lighting_ambient_color;vec3 directional_contrib=u_lighting_directional_color*dir_factor;return linearProduct(color,ambient_contrib+directional_contrib);}vec4 apply_lighting(vec4 color,vec3 normal,float dir_factor) {return vec4(apply_lighting(color.rgb,normal,dir_factor),color.a);}vec3 apply_lighting(vec3 color,vec3 normal) {float dir_factor=max(dot(normal,u_lighting_directional_dir),0.0);return apply_lighting(color.rgb,normal,dir_factor);}vec4 apply_lighting(vec4 color,vec3 normal) {float dir_factor=max(dot(normal,u_lighting_directional_dir),0.0);return vec4(apply_lighting(color.rgb,normal,dir_factor),color.a);}vec3 apply_lighting_ground(vec3 color) {return color*u_ground_radiance;}vec4 apply_lighting_ground(vec4 color) {return vec4(apply_lighting_ground(color.rgb),color.a);}float calculate_NdotL(vec3 normal) {const float ext=0.70710678118;return (clamp(dot(normal,u_lighting_directional_dir),-ext,1.0)+ext)/(1.0+ext);}vec4 apply_lighting_with_emission_ground(vec4 color,float emissive_strength) {return mix(apply_lighting_ground(color),color,emissive_strength);}vec3 compute_flood_lighting(vec3 flood_light_color,float fully_occluded_factor,float occlusion,vec3 ground_shadow_factor) {vec3 fully_occluded_color=flood_light_color*mix(ground_shadow_factor,vec3(1.0),fully_occluded_factor);float occlusion_ramp=smoothstep(0.0,0.2,1.0-occlusion);return mix(fully_occluded_color,flood_light_color,occlusion_ramp);}vec3 compute_emissive_draped(vec3 unlit_color,float fully_occluded_factor,float occlusion,vec3 ground_shadow_factor) {vec3 fully_occluded_color=unlit_color*mix(ground_shadow_factor,vec3(1.0),fully_occluded_factor);return mix(fully_occluded_color,unlit_color,1.0-occlusion);}\n#endif//LIGHTING_3D_MODE","_prelude_raster_array.glsl":xt,"_prelude_raster_particle.glsl":vt},St={};Pt("",_t),Pt(yt,gt),Pt(wt,bt),Pt(xt,""),Pt(vt,"");const Mt=Pt(pt,ft),At=dt;var It={background:Pt('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\nuniform vec4 u_color;uniform float u_opacity;\n#ifdef LIGHTING_3D_MODE\nin vec4 v_color;\n#endif\nvoid main() {vec4 out_color;\n#ifdef LIGHTING_3D_MODE\nout_color=v_color;\n#else\nout_color=u_color;\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\nglFragColor=out_color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_lighting.glsl"\nin vec2 a_pos;uniform mat4 u_matrix;\n#ifdef LIGHTING_3D_MODE\nuniform mediump vec4 u_color;out vec4 v_color;uniform float u_emissive_strength;\n#endif\nvoid main() {gl_Position=u_matrix*vec4(a_pos,0,1);\n#ifdef LIGHTING_3D_MODE\nv_color=apply_lighting_with_emission_ground(u_color,u_emissive_strength);\n#endif\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}'),backgroundPattern:Pt('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\nuniform vec2 u_pattern_tl;uniform vec2 u_pattern_br;uniform vec2 u_texsize;uniform float u_opacity;uniform float u_emissive_strength;uniform sampler2D u_image;in vec2 v_pos;void main() {vec2 imagecoord=mod(v_pos,1.0);vec2 pos=mix(u_pattern_tl/u_texsize,u_pattern_br/u_texsize,imagecoord);vec4 out_color=textureLodCustom(u_image,pos,v_pos);\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting_with_emission_ground(out_color,u_emissive_strength);\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\nglFragColor=out_color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\nuniform mat4 u_matrix;uniform vec2 u_pattern_size;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_tile_units_to_pixels;in vec2 a_pos;out vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_pattern_size,u_tile_units_to_pixels,a_pos);\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}'),circle:Pt('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\nin vec3 v_data;in float v_visibility;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nuniform float u_emissive_strength;void main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 extrude=v_data.xy;float blur_positive=blur < 0.0 ? 0.0 : 1.0;lowp float antialiasblur=v_data.z;float extrude_length=length(extrude)+antialiasblur*(1.0-blur_positive);float antialiased_blur=-max(abs(blur),antialiasblur);float opacity_t=smoothstep((1.0-blur_positive)*antialiased_blur,blur_positive*antialiased_blur,extrude_length-1.0)-smoothstep(0.0,antialiasblur,extrude_length-1.0);float color_t=stroke_width < 0.01 ? 0.0 : smoothstep(\nantialiased_blur,0.0,extrude_length-radius/(radius+stroke_width)\n);vec4 out_color=mix(color*opacity,stroke_color*stroke_opacity,color_t);\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting_with_emission_ground(out_color,u_emissive_strength);\n#endif\n#ifdef FOG\nout_color=fog_apply_premultiplied(out_color,v_fog_pos);\n#endif\nglFragColor=out_color*(v_visibility*opacity_t);\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\n}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_terrain.vertex.glsl"\n#define NUM_VISIBILITY_RINGS 2\n#define INV_SQRT2 0.70710678\n#define ELEVATION_BIAS 0.0001\n#define NUM_SAMPLES_PER_RING 16\nuniform mat4 u_matrix;uniform mat2 u_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;in vec2 a_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nin vec3 a_pos_3;in vec3 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir;\n#endif\nout vec3 v_data;out float v_visibility;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nvec2 calc_offset(vec2 extrusion,float radius,float stroke_width, float view_scale) {return extrusion*(radius+stroke_width)*u_extrude_scale*view_scale;}float cantilevered_elevation(vec2 pos,float radius,float stroke_width,float view_scale) {vec2 c1=pos+calc_offset(vec2(-1,-1),radius,stroke_width,view_scale);vec2 c2=pos+calc_offset(vec2(1,-1),radius,stroke_width,view_scale);vec2 c3=pos+calc_offset(vec2(1,1),radius,stroke_width,view_scale);vec2 c4=pos+calc_offset(vec2(-1,1),radius,stroke_width,view_scale);float h1=elevation(c1)+ELEVATION_BIAS;float h2=elevation(c2)+ELEVATION_BIAS;float h3=elevation(c3)+ELEVATION_BIAS;float h4=elevation(c4)+ELEVATION_BIAS;return max(h4,max(h3,max(h1,h2)));}float circle_elevation(vec2 pos) {\n#if defined(TERRAIN)\nreturn elevation(pos)+ELEVATION_BIAS;\n#else\nreturn 0.0;\n#endif\n}vec4 project_vertex(vec2 extrusion,vec4 world_center,vec4 projected_center,float radius,float stroke_width, float view_scale,mat3 surface_vectors) {vec2 sample_offset=calc_offset(extrusion,radius,stroke_width,view_scale);\n#ifdef PITCH_WITH_MAP\n#ifdef PROJECTION_GLOBE_VIEW\nreturn u_matrix*( world_center+vec4(sample_offset.x*surface_vectors[0]+sample_offset.y*surface_vectors[1],0) );\n#else\nreturn u_matrix*( world_center+vec4(sample_offset,0,0) );\n#endif\n#else\nreturn projected_center+vec4(sample_offset,0,0);\n#endif\n}float get_sample_step() {\n#ifdef PITCH_WITH_MAP\nreturn 2.0*PI/float(NUM_SAMPLES_PER_RING);\n#else\nreturn PI/float(NUM_SAMPLES_PER_RING);\n#endif\n}void main(void) {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 extrude=vec2(mod(a_pos,2.0)*2.0-1.0);vec2 circle_center=floor(a_pos*0.5);vec4 world_center;mat3 surface_vectors;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 pos_normal_3=a_pos_normal_3/16384.0;surface_vectors=globe_mercator_surface_vectors(pos_normal_3,u_up_dir,u_zoom_transition);vec3 surface_extrusion=extrude.x*surface_vectors[0]+extrude.y*surface_vectors[1];vec3 globe_elevation=elevationVector(circle_center)*circle_elevation(circle_center);vec3 globe_pos=a_pos_3+surface_extrusion+globe_elevation;vec3 mercator_elevation=u_up_dir*u_tile_up_scale*circle_elevation(circle_center);vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,circle_center,u_tile_id,u_merc_center)+surface_extrusion+mercator_elevation;vec3 pos=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition);world_center=vec4(pos,1);\n#else \nsurface_vectors=mat3(1.0);float height=circle_elevation(circle_center);world_center=vec4(circle_center,height,1);\n#endif\nvec4 projected_center=u_matrix*world_center;float view_scale=0.0;\n#ifdef PITCH_WITH_MAP\n#ifdef SCALE_WITH_MAP\nview_scale=1.0;\n#else\nview_scale=projected_center.w/u_camera_to_center_distance;\n#endif\n#else\n#ifdef SCALE_WITH_MAP\nview_scale=u_camera_to_center_distance;\n#else\nview_scale=projected_center.w;\n#endif\n#endif\ngl_Position=project_vertex(extrude,world_center,projected_center,radius,stroke_width,view_scale,surface_vectors);float visibility=0.0;\n#ifdef TERRAIN\nfloat step=get_sample_step();vec4 occlusion_world_center;vec4 occlusion_projected_center;\n#ifdef PITCH_WITH_MAP\nfloat cantilevered_height=cantilevered_elevation(circle_center,radius,stroke_width,view_scale);occlusion_world_center=vec4(circle_center,cantilevered_height,1);occlusion_projected_center=u_matrix*occlusion_world_center;\n#else\nocclusion_world_center=world_center;occlusion_projected_center=projected_center;\n#endif\nfor(int ring=0; ring < NUM_VISIBILITY_RINGS; ring++) {float scale=(float(ring)+1.0)/float(NUM_VISIBILITY_RINGS);for(int i=0; i < NUM_SAMPLES_PER_RING; i++) {vec2 extrusion=vec2(cos(step*float(i)),-sin(step*float(i)))*scale;vec4 frag_pos=project_vertex(extrusion,occlusion_world_center,occlusion_projected_center,radius,stroke_width,view_scale,surface_vectors);visibility+=float(!isOccluded(frag_pos));}}visibility/=float(NUM_VISIBILITY_RINGS)*float(NUM_SAMPLES_PER_RING);\n#else\nvisibility=1.0;\n#endif\n#ifdef PROJECTION_GLOBE_VIEW\nvisibility=1.0;\n#endif\nv_visibility=visibility;lowp float antialiasblur=1.0/u_device_pixel_ratio/(radius+stroke_width);v_data=vec3(extrude.x,extrude.y,antialiasblur);\n#ifdef FOG\nv_fog_pos=fog_position(world_center.xyz);\n#endif\n}'),clippingMask:Pt("void main() {glFragColor=vec4(1.0);}","in vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),heatmap:Pt('#include "_prelude_fog.fragment.glsl"\nuniform highp float u_intensity;in vec2 v_extrude;\n#pragma mapbox: define highp float weight\n#define GAUSS_COEF 0.3989422804014327\nvoid main() {\n#pragma mapbox: initialize highp float weight\nfloat d=-0.5*3.0*3.0*dot(v_extrude,v_extrude);float val=weight*u_intensity*GAUSS_COEF*exp(d);glFragColor=vec4(val,1.0,1.0,1.0);\n#ifdef FOG\nif (u_is_globe==0) {glFragColor.r*=pow(1.0-fog_opacity(v_fog_pos),2.0);}\n#endif\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_terrain.vertex.glsl"\n#include "_prelude_fog.vertex.glsl"\nuniform mat4 u_matrix;uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;in vec2 a_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nin vec3 a_pos_3;in vec3 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir;\n#endif\nout vec2 v_extrude;\n#pragma mapbox: define highp float weight\n#pragma mapbox: define mediump float radius\nconst highp float ZERO=1.0/255.0/16.0;\n#define GAUSS_COEF 0.3989422804014327\nvoid main(void) {\n#pragma mapbox: initialize highp float weight\n#pragma mapbox: initialize mediump float radius\nvec2 unscaled_extrude=vec2(mod(a_pos,2.0)*2.0-1.0);float S=sqrt(-2.0*log(ZERO/weight/u_intensity/GAUSS_COEF))/3.0;v_extrude=S*unscaled_extrude;vec2 extrude=v_extrude*radius*u_extrude_scale;vec2 tilePos=floor(a_pos*0.5);vec3 pos;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 pos_normal_3=a_pos_normal_3/16384.0;mat3 surface_vectors=globe_mercator_surface_vectors(pos_normal_3,u_up_dir,u_zoom_transition);vec3 surface_extrusion=extrude.x*surface_vectors[0]+extrude.y*surface_vectors[1];vec3 globe_elevation=elevationVector(tilePos)*elevation(tilePos);vec3 globe_pos=a_pos_3+surface_extrusion+globe_elevation;vec3 mercator_elevation=u_up_dir*u_tile_up_scale*elevation(tilePos);vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,tilePos,u_tile_id,u_merc_center)+surface_extrusion+mercator_elevation;pos=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition);\n#else\npos=vec3(tilePos+extrude,elevation(tilePos));\n#endif\ngl_Position=u_matrix*vec4(pos,1);\n#ifdef FOG\nv_fog_pos=fog_position(pos);\n#endif\n}'),heatmapTexture:Pt("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));glFragColor=color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(0.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}","in vec2 a_pos;out vec2 v_pos;void main() {gl_Position=vec4(a_pos,0,1);v_pos=a_pos*0.5+0.5;}"),collisionBox:Pt("in float v_placed;in float v_notUsed;void main() {vec4 red =vec4(1.0,0.0,0.0,1.0);vec4 blue=vec4(0.0,0.0,1.0,0.5);glFragColor =mix(red,blue,step(0.5,v_placed))*0.5;glFragColor*=mix(1.0,0.1,step(0.5,v_notUsed));}",'#include "_prelude_terrain.vertex.glsl"\nin vec3 a_pos;in vec2 a_anchor_pos;in vec2 a_extrude;in vec2 a_placed;in vec2 a_shift;in float a_size_scale;in vec2 a_padding;in float a_z_offset;uniform mat4 u_matrix;uniform vec2 u_extrude_scale;uniform float u_camera_to_center_distance;out float v_placed;out float v_notUsed;void main() {vec4 projectedPoint=u_matrix*vec4(a_pos+elevationVector(a_anchor_pos)*(a_z_offset+elevation(a_anchor_pos)),1);highp float camera_to_anchor_distance=projectedPoint.w;highp float collision_perspective_ratio=clamp(\n0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,1.5);gl_Position=projectedPoint;gl_Position.xy+=(a_extrude*a_size_scale+a_shift+a_padding)*u_extrude_scale*gl_Position.w*collision_perspective_ratio;v_placed=a_placed.x;v_notUsed=a_placed.y;}'),collisionCircle:Pt("in float v_radius;in vec2 v_extrude;in float v_perspective_ratio;in float v_collision;void main() {float alpha=0.5*min(v_perspective_ratio,1.0);float stroke_radius=0.9*max(v_perspective_ratio,1.0);float distance_to_center=length(v_extrude);float distance_to_edge=abs(distance_to_center-v_radius);float opacity_t=smoothstep(-stroke_radius,0.0,-distance_to_edge);vec4 color=mix(vec4(0.0,0.0,1.0,0.5),vec4(1.0,0.0,0.0,1.0),v_collision);glFragColor=color*alpha*opacity_t;}","in vec2 a_pos_2f;in float a_radius;in vec2 a_flags;uniform mat4 u_matrix;uniform mat4 u_inv_matrix;uniform vec2 u_viewport_size;uniform float u_camera_to_center_distance;out float v_radius;out vec2 v_extrude;out float v_perspective_ratio;out float v_collision;vec3 toTilePosition(vec2 screenPos) {vec4 rayStart=u_inv_matrix*vec4(screenPos,-1.0,1.0);vec4 rayEnd =u_inv_matrix*vec4(screenPos, 1.0,1.0);rayStart.xyz/=rayStart.w;rayEnd.xyz /=rayEnd.w;highp float t=(0.0-rayStart.z)/(rayEnd.z-rayStart.z);return mix(rayStart.xyz,rayEnd.xyz,t);}void main() {vec2 quadCenterPos=a_pos_2f;float radius=a_radius;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(\nmix(-1.0,1.0,float(vertexIdx >=2.0)),mix(-1.0,1.0,float(vertexIdx >=1.0 && vertexIdx <=2.0)));vec2 quadVertexExtent=quadVertexOffset*radius;vec3 tilePos=toTilePosition(quadCenterPos);vec4 clipPos=u_matrix*vec4(tilePos,1.0);highp float camera_to_anchor_distance=clipPos.w;highp float collision_perspective_ratio=clamp(\n0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_perspective_ratio=collision_perspective_ratio;v_collision=collision;gl_Position=vec4(clipPos.xyz/clipPos.w,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}"),debug:Pt("uniform highp vec4 u_color;uniform sampler2D u_overlay;in vec2 v_uv;void main() {vec4 overlay_color=texture(u_overlay,v_uv);glFragColor=mix(u_color,overlay_color,overlay_color.a);}",'#include "_prelude_terrain.vertex.glsl"\nin vec2 a_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nin vec3 a_pos_3;\n#endif\nout vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {float h=elevation(a_pos);v_uv=a_pos/8192.0;\n#ifdef PROJECTION_GLOBE_VIEW\ngl_Position=u_matrix*vec4(a_pos_3+elevationVector(a_pos)*h,1);\n#else\ngl_Position=u_matrix*vec4(a_pos*u_overlay_scale,h,1);\n#endif\n}'),fill:Pt('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nuniform float u_emissive_strength;void main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\nvec4 out_color=color;\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting_with_emission_ground(out_color,u_emissive_strength);\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\nglFragColor=out_color*opacity;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\nin vec2 a_pos;uniform mat4 u_matrix;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}'),fillOutline:Pt('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\nin highp vec2 v_pos;uniform float u_emissive_strength;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);vec4 out_color=outline_color;\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting_with_emission_ground(out_color,u_emissive_strength);\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\nglFragColor=out_color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\nin vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;out highp vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}'),fillOutlinePattern:Pt('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\nuniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_emissive_strength;in highp vec2 v_pos;in highp vec2 v_pos_world;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern\nvec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec2 imagecoord=mod(v_pos,1.0);vec2 pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,imagecoord);vec2 lod_pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,v_pos);float dist=length(v_pos_world-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);vec4 out_color=textureLodCustom(u_image,pos,lod_pos);\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting_with_emission_ground(out_color,u_emissive_strength);\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\nglFragColor=out_color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\nuniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_tile_units_to_pixels;in vec2 a_pos;out highp vec2 v_pos;out highp vec2 v_pos_world;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern\n#pragma mapbox: define lowp float pixel_ratio\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern\n#pragma mapbox: initialize lowp float pixel_ratio\nvec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;gl_Position=u_matrix*vec4(a_pos,0,1);vec2 display_size=(pattern_br-pattern_tl)/pixel_ratio;v_pos=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,display_size,u_tile_units_to_pixels,a_pos);v_pos_world=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}'),fillPattern:Pt('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\nuniform vec2 u_texsize;uniform sampler2D u_image;in vec2 v_pos;uniform float u_emissive_strength;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern\nvec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec2 imagecoord=mod(v_pos,1.0);vec2 pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,imagecoord);vec2 lod_pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,v_pos);vec4 out_color=textureLodCustom(u_image,pos,lod_pos);\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting_with_emission_ground(out_color,u_emissive_strength);\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\nglFragColor=out_color*opacity;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\nuniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_tile_units_to_pixels;in vec2 a_pos;out vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern\n#pragma mapbox: define lowp float pixel_ratio\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern\n#pragma mapbox: initialize lowp float pixel_ratio\nvec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec2 display_size=(pattern_br-pattern_tl)/pixel_ratio;gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,display_size,u_tile_units_to_pixels,a_pos);\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}'),fillExtrusion:Pt('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_shadow.fragment.glsl"\n#include "_prelude_lighting.glsl"\nin vec4 v_color;in vec4 v_flat;\n#ifdef RENDER_SHADOWS\nin highp vec4 v_pos_light_view_0;in highp vec4 v_pos_light_view_1;\n#endif\nuniform lowp float u_opacity;\n#ifdef FAUX_AO\nuniform lowp vec2 u_ao;in vec2 v_ao;\n#endif\n#if defined(ZERO_ROOF_RADIUS) && !defined(LIGHTING_3D_MODE)\nin vec4 v_roof_color;\n#endif\n#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS) || defined(LIGHTING_3D_MODE)\nin highp vec3 v_normal;\n#endif\nuniform vec3 u_flood_light_color;uniform highp float u_vertical_scale;uniform float u_flood_light_intensity;uniform vec3 u_ground_shadow_factor;\n#if defined(LIGHTING_3D_MODE) && defined(FLOOD_LIGHT)\nin float v_flood_radius;in float v_has_floodlight;\n#endif\nuniform float u_emissive_strength;in float v_height;void main() {\n#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS) || defined(LIGHTING_3D_MODE)\nvec3 normal=normalize(v_normal);\n#endif\nfloat z;vec4 color=v_color;\n#ifdef ZERO_ROOF_RADIUS\nz=float(normal.z > 0.00001);\n#ifdef LIGHTING_3D_MODE\nnormal=mix(normal,vec3(0.0,0.0,1.0),z);\n#else\ncolor=mix(v_color,v_roof_color,z);\n#endif\n#endif\nfloat h=max(0.0,v_height);float ao_shade=1.0;\n#ifdef FAUX_AO\nfloat intensity=u_ao[0];float h_floors=h/(u_ao[1]*u_vertical_scale);float y_shade=1.0-0.9*intensity*min(v_ao.y,1.0);ao_shade=(1.0-0.08*intensity)*(y_shade+(1.0-y_shade)*(1.0-pow(1.0-min(h_floors/16.0,1.0),16.0)))+0.08*intensity*min(h_floors/160.0,1.0);float concave=v_ao.x*v_ao.x;\n#ifdef ZERO_ROOF_RADIUS\nconcave*=(1.0-z);\n#endif\nfloat x_shade=mix(1.0,mix(0.6,0.75,min(h_floors/30.0,1.0)),intensity)+0.1*intensity*min(h,1.0);ao_shade*=mix(1.0,x_shade*x_shade*x_shade,concave);\n#ifdef LIGHTING_3D_MODE\n#ifdef FLOOD_LIGHT\ncolor.rgb*=mix(ao_shade,1.0,v_has_floodlight);\n#else\ncolor.rgb*=ao_shade;\n#endif\n#else\ncolor.rgb*=ao_shade;\n#endif\n#endif\n#ifdef LIGHTING_3D_MODE\nfloat flood_radiance=0.0;\n#ifdef FLOOD_LIGHT\nflood_radiance=(1.0-min(h/v_flood_radius,1.0))*u_flood_light_intensity*v_has_floodlight;\n#endif\n#ifdef RENDER_SHADOWS\n#ifdef FLOOD_LIGHT\nfloat ndotl_unclamped=dot(normal,u_shadow_direction);float ndotl=max(0.0,ndotl_unclamped);float occlusion=ndotl_unclamped < 0.0 ? 1.0 : shadow_occlusion(ndotl,v_pos_light_view_0,v_pos_light_view_1,1.0/gl_FragCoord.w);vec3 litColor=apply_lighting(color.rgb,normal,(1.0-u_shadow_intensity*occlusion)*ndotl);vec3 floodLitColor=compute_flood_lighting(u_flood_light_color*u_opacity,1.0-u_shadow_intensity,occlusion,u_ground_shadow_factor);color.rgb=mix(litColor,floodLitColor,flood_radiance);\n#else\nfloat shadowed_lighting_factor;\n#ifdef RENDER_CUTOFF\nshadowed_lighting_factor=shadowed_light_factor_normal_opacity(normal,v_pos_light_view_0,v_pos_light_view_1,1.0/gl_FragCoord.w,v_cutoff_opacity);if (v_cutoff_opacity==0.0) {discard;}\n#else\nshadowed_lighting_factor=shadowed_light_factor_normal(normal,v_pos_light_view_0,v_pos_light_view_1,1.0/gl_FragCoord.w);\n#endif\ncolor.rgb=apply_lighting(color.rgb,normal,shadowed_lighting_factor);\n#endif\n#else\ncolor.rgb=apply_lighting(color.rgb,normal);\n#ifdef FLOOD_LIGHT\ncolor.rgb=mix(color.rgb,u_flood_light_color*u_opacity,flood_radiance);\n#endif\n#endif\ncolor.rgb=mix(color.rgb,v_flat.rgb,u_emissive_strength);color*=u_opacity;\n#endif\n#ifdef FOG\ncolor=fog_dither(fog_apply_premultiplied(color,v_fog_pos,h));\n#endif\n#ifdef INDICATOR_CUTOUT\ncolor=applyCutout(color);\n#endif\nglFragColor=color;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_terrain.vertex.glsl"\n#include "_prelude_shadow.vertex.glsl"\n#include "_prelude_lighting.glsl"\nuniform mat4 u_matrix;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform float u_edge_radius;uniform float u_alignment;uniform float u_width_scale;in vec4 a_pos_normal_ed;in vec2 a_centroid_pos;\n#ifdef RENDER_WALL_MODE\nin vec4 a_join_normal_inside_polygon;\n#endif\n#ifdef PROJECTION_GLOBE_VIEW\nin vec3 a_pos_3;in vec3 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir;uniform float u_height_lift;\n#endif\nuniform highp float u_vertical_scale;out vec4 v_color;out vec4 v_flat;\n#ifdef RENDER_SHADOWS\nuniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out highp vec4 v_pos_light_view_0;out highp vec4 v_pos_light_view_1;\n#endif\n#if defined(ZERO_ROOF_RADIUS) && !defined(LIGHTING_3D_MODE)\nout vec4 v_roof_color;\n#endif\n#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS) || defined(LIGHTING_3D_MODE)\nout highp vec3 v_normal;\n#endif\n#ifdef FAUX_AO\nuniform lowp vec2 u_ao;out vec2 v_ao;\n#endif\n#if defined(LIGHTING_3D_MODE) && defined(FLOOD_LIGHT)\nout float v_flood_radius;out float v_has_floodlight;\n#endif\nout float v_height;\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define highp float flood_light_wall_radius\n#pragma mapbox: define highp float line_width\nvoid main() {\n#pragma mapbox: initialize highp float base\n#pragma mapbox: initialize highp float height\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize highp float flood_light_wall_radius\n#pragma mapbox: initialize highp float line_width\nbase*=u_vertical_scale;height*=u_vertical_scale;vec4 pos_nx=floor(a_pos_normal_ed*0.5);vec4 top_up_ny_start=a_pos_normal_ed-2.0*pos_nx;vec3 top_up_ny=top_up_ny_start.xyz;float x_normal=pos_nx.z/8192.0;vec3 normal=top_up_ny.y==1.0 ? vec3(0.0,0.0,1.0) : normalize(vec3(x_normal,(2.0*top_up_ny.z-1.0)*(1.0-abs(x_normal)),0.0));\n#if defined(ZERO_ROOF_RADIUS) || defined(RENDER_SHADOWS) || defined(LIGHTING_3D_MODE)\nv_normal=normal;\n#endif\nbase=max(0.0,base);float attr_height=height;height=max(0.0,top_up_ny.y==0.0 && top_up_ny.x==1.0 ? height-u_edge_radius : height);float t=top_up_ny.x;vec2 centroid_pos=vec2(0.0);\n#if defined(HAS_CENTROID) || defined(TERRAIN)\ncentroid_pos=a_centroid_pos;\n#endif\nfloat ele=0.0;float h=0.0;float c_ele=0.0;vec3 pos;\n#ifdef TERRAIN\nbool flat_roof=centroid_pos.x !=0.0 && t > 0.0;ele=elevation(pos_nx.xy);c_ele=flat_roof ? centroid_pos.y==0.0 ? elevationFromUint16(centroid_pos.x) : flatElevation(centroid_pos) : ele;h=flat_roof ? max(c_ele+height,ele+base+2.0) : ele+(t > 0.0 ? height : base==0.0 ?-5.0 : base);pos=vec3(pos_nx.xy,h);\n#else\nh=t > 0.0 ? height : base;pos=vec3(pos_nx.xy,h);\n#endif\n#ifdef PROJECTION_GLOBE_VIEW\nfloat lift=float((t+base) > 0.0)*u_height_lift;h+=lift;vec3 globe_normal=normalize(mix(a_pos_normal_3/16384.0,u_up_dir,u_zoom_transition));vec3 globe_pos=a_pos_3+globe_normal*(u_tile_up_scale*h);vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,pos.xy,u_tile_id,u_merc_center)+u_up_dir*u_tile_up_scale*pos.z;pos=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition);\n#endif\nfloat cutoff=1.0;vec3 scaled_pos=pos;\n#ifdef RENDER_CUTOFF\nvec3 centroid_random=vec3(centroid_pos.xy,centroid_pos.x+centroid_pos.y+1.0);vec3 ground_pos=centroid_pos.x==0.0 ? pos.xyz : (centroid_random/8.0);vec4 ground=u_matrix*vec4(ground_pos.xy,ele,1.0);cutoff=cutoff_opacity(u_cutoff_params,ground.z);if (centroid_pos.y !=0.0 && centroid_pos.x !=0.0) {vec3 g=floor(ground_pos);vec3 mod_=centroid_random-g*8.0;float seed=min(1.0,0.1*(min(3.5,max(mod_.x+mod_.y,0.2*attr_height))*0.35+mod_.z));if (cutoff < 0.8-seed) {cutoff=0.0;}}float cutoff_scale=cutoff;v_cutoff_opacity=cutoff;scaled_pos.z=mix(c_ele,h,cutoff_scale);\n#endif\nfloat hidden=float((centroid_pos.x==0.0 && centroid_pos.y==1.0) || (cutoff==0.0 && centroid_pos.x !=0.0));\n#ifdef RENDER_WALL_MODE\nvec2 wall_offset=u_width_scale*line_width*(a_join_normal_inside_polygon.xy/EXTENT);float isPolygon=a_join_normal_inside_polygon.w;float sideAlignment=abs(isPolygon*u_alignment);scaled_pos.xy+=(1.0-a_join_normal_inside_polygon.z)*mix(wall_offset*0.5,wall_offset*mix(1.0,0.0,max(u_alignment,0.0)),sideAlignment);scaled_pos.xy-=a_join_normal_inside_polygon.z*mix(wall_offset*0.5,wall_offset*mix(0.0,1.0,max(u_alignment,0.0)),sideAlignment);\n#endif\ngl_Position=mix(u_matrix*vec4(scaled_pos,1),AWAY,hidden);h=h-ele;v_height=h;\n#ifdef RENDER_SHADOWS\nvec3 shd_pos0=pos;vec3 shd_pos1=pos;\n#ifdef NORMAL_OFFSET\nvec3 offset=shadow_normal_offset(normal);shd_pos0+=offset*shadow_normal_offset_multiplier0();shd_pos1+=offset*shadow_normal_offset_multiplier1();\n#endif\nv_pos_light_view_0=u_light_matrix_0*vec4(shd_pos0,1);v_pos_light_view_1=u_light_matrix_1*vec4(shd_pos1,1);\n#endif\nfloat NdotL=0.0;float colorvalue=0.0;\n#ifndef LIGHTING_3D_MODE\ncolorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;NdotL=clamp(dot(normal,u_lightpos),0.0,1.0);NdotL=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),NdotL);if (normal.y !=0.0) {float r=0.84;r=mix(0.7,0.98,1.0-u_lightintensity);NdotL*=(\n(1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),r,1.0)));}\n#endif\n#ifdef FAUX_AO\nfloat concave=pos_nx.w-floor(pos_nx.w*0.5)*2.0;float start=top_up_ny_start.w;float y_ground=1.0-clamp(t+base,0.0,1.0);float top_height=height;\n#ifdef TERRAIN\ntop_height=mix(max(c_ele+height,ele+base+2.0),ele+height,float(centroid_pos.x==0.0))-ele;y_ground+=y_ground*5.0/max(3.0,top_height);\n#endif\nv_ao=vec2(mix(concave,-concave,start),y_ground);NdotL*=(1.0+0.05*(1.0-top_up_ny.y)*u_ao[0]);\n#ifdef PROJECTION_GLOBE_VIEW\ntop_height+=u_height_lift;\n#endif\ngl_Position.z-=(0.0000006*(min(top_height,500.)+2.0*min(base,500.0)+60.0*concave+3.0*start))*gl_Position.w;\n#endif\n#ifdef LIGHTING_3D_MODE\n#ifdef FLOOD_LIGHT\nfloat is_wall=1.0-float(t > 0.0 && top_up_ny.y > 0.0);v_has_floodlight=float(flood_light_wall_radius > 0.0 && is_wall > 0.0);v_flood_radius=flood_light_wall_radius*u_vertical_scale;\n#endif\nv_color=vec4(color.rgb,1.0);v_flat=vec4(linearProduct(color.rgb,vec3(calculate_NdotL(normal))),1.0);\n#else\nv_color=vec4(0.0,0.0,0.0,1.0);v_color.rgb+=clamp(color.rgb*NdotL*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_color*=u_opacity;\n#endif\n#if defined(ZERO_ROOF_RADIUS) && !defined(LIGHTING_3D_MODE)\nfloat roofNdotL=clamp(u_lightpos.z,0.0,1.0);roofNdotL=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),roofNdotL);v_roof_color=vec4(0.0,0.0,0.0,1.0);v_roof_color.rgb+=clamp(color.rgb*roofNdotL*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_roof_color*=u_opacity;\n#endif\n#ifdef FOG\nv_fog_pos=fog_position(pos);\n#endif\n}'),fillExtrusionDepth:Pt("in highp float v_depth;void main() {\n#ifndef DEPTH_TEXTURE\nglFragColor=pack_depth(v_depth);\n#endif\n}",'#include "_prelude_terrain.vertex.glsl"\nuniform mat4 u_matrix;uniform float u_edge_radius;uniform float u_alignment;uniform float u_width_scale;uniform float u_vertical_scale;in vec4 a_pos_normal_ed;in vec2 a_centroid_pos;\n#ifdef RENDER_WALL_MODE\nin vec4 a_join_normal_inside_polygon;\n#endif\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\n#pragma mapbox: define highp float line_width\nout highp float v_depth;void main() {\n#pragma mapbox: initialize highp float base\n#pragma mapbox: initialize highp float height\n#pragma mapbox: initialize highp float line_width\nbase*=u_vertical_scale;height*=u_vertical_scale;vec3 pos_nx=floor(a_pos_normal_ed.xyz*0.5);mediump vec3 top_up_ny=a_pos_normal_ed.xyz-2.0*pos_nx;base=max(0.0,base);height=max(0.0,top_up_ny.y==0.0 && top_up_ny.x==1.0 ? height-u_edge_radius : height);float t=top_up_ny.x;vec2 centroid_pos=vec2(0.0);\n#if defined(HAS_CENTROID) || defined(TERRAIN)\ncentroid_pos=a_centroid_pos;\n#endif\nvec3 pos;\n#ifdef TERRAIN\nbool flat_roof=centroid_pos.x !=0.0 && t > 0.0;float ele=elevation(pos_nx.xy);float c_ele=flat_roof ? centroid_pos.y==0.0 ? elevationFromUint16(centroid_pos.x) : flatElevation(centroid_pos) : ele;float h=flat_roof ? max(c_ele+height,ele+base+2.0) : ele+(t > 0.0 ? height : base);pos=vec3(pos_nx.xy,h);\n#else\npos=vec3(pos_nx.xy,t > 0.0 ? height : base);\n#endif\n#ifdef RENDER_WALL_MODE\nvec2 wall_offset=u_width_scale*line_width*(a_join_normal_inside_polygon.xy/EXTENT);float isPolygon=a_join_normal_inside_polygon.w;float sideAlignment=abs(isPolygon*u_alignment);pos.xy+=(1.0-a_join_normal_inside_polygon.z)*mix(wall_offset*0.5,wall_offset*mix(1.0,0.0,max(u_alignment,0.0)),sideAlignment);pos.xy-=a_join_normal_inside_polygon.z*mix(wall_offset*0.5,wall_offset*mix(0.0,1.0,max(u_alignment,0.0)),sideAlignment);\n#endif\nfloat hidden=float(centroid_pos.x==0.0 && centroid_pos.y==1.0);gl_Position=mix(u_matrix*vec4(pos,1),AWAY,hidden);v_depth=gl_Position.z/gl_Position.w;}'),fillExtrusionPattern:Pt('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\nuniform vec2 u_texsize;uniform sampler2D u_image;\n#ifdef FAUX_AO\nuniform lowp vec2 u_ao;in vec3 v_ao;\n#endif\n#ifdef LIGHTING_3D_MODE\nin vec3 v_normal;\n#endif\nin vec2 v_pos;in vec4 v_lighting;uniform lowp float u_opacity;\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\n#pragma mapbox: define mediump vec4 pattern\n#pragma mapbox: define highp float pixel_ratio\nvoid main() {\n#pragma mapbox: initialize highp float base\n#pragma mapbox: initialize highp float height\n#pragma mapbox: initialize mediump vec4 pattern\n#pragma mapbox: initialize highp float pixel_ratio\nvec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec2 imagecoord=mod(v_pos,1.0);vec2 pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,imagecoord);vec2 lod_pos=mix(pattern_tl/u_texsize,pattern_br/u_texsize,v_pos);vec4 out_color=textureLodCustom(u_image,pos,lod_pos);\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting(out_color,normalize(v_normal))*u_opacity;\n#else\nout_color=out_color*v_lighting;\n#endif\n#ifdef FAUX_AO\nfloat intensity=u_ao[0];float h=max(0.0,v_ao.z);float h_floors=h/u_ao[1];float y_shade=1.0-0.9*intensity*min(v_ao.y,1.0);float shade=(1.0-0.08*intensity)*(y_shade+(1.0-y_shade)*(1.0-pow(1.0-min(h_floors/16.0,1.0),16.0)))+0.08*intensity*min(h_floors/160.0,1.0);float concave=v_ao.x*v_ao.x;float x_shade=mix(1.0,mix(0.6,0.75,min(h_floors/30.0,1.0)),intensity)+0.1*intensity*min(h,1.0);shade*=mix(1.0,x_shade*x_shade*x_shade,concave);out_color.rgb=out_color.rgb*shade;\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\n#ifdef INDICATOR_CUTOUT\nout_color=applyCutout(out_color);\n#endif\nglFragColor=out_color;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_terrain.vertex.glsl"\n#include "_prelude_lighting.glsl"\nuniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform float u_tile_units_to_pixels;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform float u_alignment;uniform float u_width_scale;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;in vec4 a_pos_normal_ed;in vec2 a_centroid_pos;\n#ifdef RENDER_WALL_MODE\nin vec4 a_join_normal_inside_polygon;\n#endif\n#ifdef PROJECTION_GLOBE_VIEW\nin vec3 a_pos_3;in vec3 a_pos_normal_3;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_tile_id;uniform float u_zoom_transition;uniform vec3 u_up_dir;uniform float u_height_lift;\n#endif\nout vec2 v_pos;out vec4 v_lighting;\n#ifdef FAUX_AO\nuniform lowp vec2 u_ao;out vec3 v_ao;\n#endif\n#ifdef LIGHTING_3D_MODE\nout vec3 v_normal;\n#endif\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\n#pragma mapbox: define mediump vec4 pattern\n#pragma mapbox: define highp float pixel_ratio\n#pragma mapbox: define highp float line_width\nvoid main() {\n#pragma mapbox: initialize highp float base\n#pragma mapbox: initialize highp float height\n#pragma mapbox: initialize mediump vec4 pattern\n#pragma mapbox: initialize highp float pixel_ratio\n#pragma mapbox: initialize highp float line_width\nvec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec4 pos_nx=floor(a_pos_normal_ed*0.5);mediump vec4 top_up_ny_start=a_pos_normal_ed-2.0*pos_nx;mediump vec3 top_up_ny=top_up_ny_start.xyz;float x_normal=pos_nx.z/8192.0;vec3 normal=top_up_ny.y==1.0 ? vec3(0.0,0.0,1.0) : normalize(vec3(x_normal,(2.0*top_up_ny.z-1.0)*(1.0-abs(x_normal)),0.0));float edgedistance=a_pos_normal_ed.w;vec2 display_size=(pattern_br-pattern_tl)/pixel_ratio;base=max(0.0,base);height=max(0.0,height);float t=top_up_ny.x;float z=t > 0.0 ? height : base;vec2 centroid_pos=vec2(0.0);\n#if defined(HAS_CENTROID) || defined(TERRAIN)\ncentroid_pos=a_centroid_pos;\n#endif\nfloat ele=0.0;float h=z;vec3 p;float c_ele;\n#ifdef TERRAIN\nbool flat_roof=centroid_pos.x !=0.0 && t > 0.0;ele=elevation(pos_nx.xy);c_ele=flat_roof ? centroid_pos.y==0.0 ? elevationFromUint16(centroid_pos.x) : flatElevation(centroid_pos) : ele;h=flat_roof ? max(c_ele+height,ele+base+2.0) : ele+(t > 0.0 ? height : base==0.0 ?-5.0 : base);p=vec3(pos_nx.xy,h);\n#else\np=vec3(pos_nx.xy,z);\n#endif\n#ifdef PROJECTION_GLOBE_VIEW\nfloat lift=float((t+base) > 0.0)*u_height_lift;h+=lift;vec3 globe_normal=normalize(mix(a_pos_normal_3/16384.0,u_up_dir,u_zoom_transition));vec3 globe_pos=a_pos_3+globe_normal*(u_tile_up_scale*(p.z+lift));vec3 merc_pos=mercator_tile_position(u_inv_rot_matrix,p.xy,u_tile_id,u_merc_center)+u_up_dir*u_tile_up_scale*p.z;p=mix_globe_mercator(globe_pos,merc_pos,u_zoom_transition);\n#endif\n#ifdef RENDER_WALL_MODE\nvec2 wall_offset=u_width_scale*line_width*(a_join_normal_inside_polygon.xy/EXTENT);float isPolygon=a_join_normal_inside_polygon.w;float sideAlignment=abs(isPolygon*u_alignment);p.xy+=(1.0-a_join_normal_inside_polygon.z)*mix(wall_offset*0.5,wall_offset*mix(1.0,0.0,max(u_alignment,0.0)),sideAlignment);p.xy-=a_join_normal_inside_polygon.z*mix(wall_offset*0.5,wall_offset*mix(0.0,1.0,max(u_alignment,0.0)),sideAlignment);\n#endif\nfloat hidden=float(centroid_pos.x==0.0 && centroid_pos.y==1.0);gl_Position=mix(u_matrix*vec4(p,1),AWAY,hidden);vec2 pos=normal.z==1.0\n? pos_nx.xy\n: vec2(edgedistance,z*u_height_factor);v_pos=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,display_size,u_tile_units_to_pixels,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float NdotL=0.0;\n#ifdef LIGHTING_3D_MODE\nNdotL=calculate_NdotL(normal);\n#else\nNdotL=clamp(dot(normal,u_lightpos),0.0,1.0);NdotL=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),NdotL);\n#endif\nif (normal.y !=0.0) {float r=0.84;\n#ifndef LIGHTING_3D_MODE\nr=mix(0.7,0.98,1.0-u_lightintensity);\n#endif\nNdotL*=(\n(1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),r,1.0)));}\n#ifdef FAUX_AO\nfloat concave=pos_nx.w-floor(pos_nx.w*0.5)*2.0;float start=top_up_ny_start.w;float y_ground=1.0-clamp(t+base,0.0,1.0);float top_height=height;\n#ifdef TERRAIN\ntop_height=mix(max(c_ele+height,ele+base+2.0),ele+height,float(centroid_pos.x==0.0))-ele;y_ground+=y_ground*5.0/max(3.0,top_height);\n#endif\nv_ao=vec3(mix(concave,-concave,start),y_ground,h-ele);NdotL*=(1.0+0.05*(1.0-top_up_ny.y)*u_ao[0]);\n#ifdef PROJECTION_GLOBE_VIEW\ntop_height+=u_height_lift;\n#endif\ngl_Position.z-=(0.0000006*(min(top_height,500.)+2.0*min(base,500.0)+60.0*concave+3.0*start))*gl_Position.w;\n#endif\n#ifdef LIGHTING_3D_MODE\nv_normal=normal;\n#else\nv_lighting.rgb+=clamp(NdotL*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;\n#endif \n#ifdef FOG\nv_fog_pos=fog_position(p);\n#endif\n}'),groundShadow:Pt('#include "_prelude_shadow.fragment.glsl"\nprecision highp float;uniform vec3 u_ground_shadow_factor;in vec4 v_pos_light_view_0;in vec4 v_pos_light_view_1;\n#ifdef FOG\nin float v_fog_opacity;\n#endif\nvoid main() {float light=shadowed_light_factor(v_pos_light_view_0,v_pos_light_view_1,1.0/gl_FragCoord.w);vec3 shadow=mix(u_ground_shadow_factor,vec3(1.0),light);\n#ifdef RENDER_CUTOFF\nshadow=mix(vec3(1.0),shadow,cutoff_opacity(u_cutoff_params,1.0/gl_FragCoord.w));\n#endif\n#ifdef FOG\nshadow=mix(shadow,vec3(1.0),v_fog_opacity);\n#endif\n#ifdef INDICATOR_CUTOUT\nshadow=mix(shadow,vec3(1.0),1.0-applyCutout(vec4(1.0)).r);\n#endif\nglFragColor=vec4(shadow,1.0);}','#include "_prelude_fog.vertex.glsl"\nuniform mat4 u_matrix;uniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;in vec2 a_pos;out vec4 v_pos_light_view_0;out vec4 v_pos_light_view_1;\n#ifdef FOG\nout float v_fog_opacity;\n#endif\nvoid main() {gl_Position=u_matrix*vec4(a_pos,0.0,1.0);v_pos_light_view_0=u_light_matrix_0*vec4(a_pos,0.0,1.0);v_pos_light_view_1=u_light_matrix_1*vec4(a_pos,0.0,1.0);\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);v_fog_opacity=fog(v_fog_pos);\n#endif\n}'),fillExtrusionGroundEffect:Pt("uniform highp float u_ao_pass;uniform highp float u_opacity;uniform highp float u_flood_light_intensity;uniform highp vec3 u_flood_light_color;uniform highp float u_attenuation;uniform sampler2D u_fb;uniform float u_fb_size;\n#ifdef SDF_SUBPASS\nin highp vec2 v_pos;in highp vec4 v_line_segment;in highp float v_flood_light_radius_tile;in highp vec2 v_ao;float line_df(highp vec2 a,highp vec2 b,highp vec2 p) {highp vec2 ba=b-a;highp vec2 pa=p-a;highp float r=clamp(dot(pa,ba)/dot(ba,ba),0.0,1.0);return length(pa-r*ba);}\n#ifdef FOG\nin highp float v_fog;\n#endif\n#endif\nvoid main() {\n#ifdef CLEAR_SUBPASS\nvec4 color=vec4(1.0);\n#ifdef CLEAR_FROM_TEXTURE\ncolor=texture(u_fb,gl_FragCoord.xy/vec2(u_fb_size));\n#endif\nglFragColor=color;\n#else\n#ifdef SDF_SUBPASS\nhighp float d=line_df(v_line_segment.xy,v_line_segment.zw,v_pos);highp float effect_radius=mix(v_flood_light_radius_tile,v_ao.y,u_ao_pass);d/=effect_radius;d=min(d,1.0);d=1.0-pow(1.0-d,u_attenuation);highp float effect_intensity=mix(u_flood_light_intensity,v_ao.x,u_ao_pass);highp float fog=1.0;\n#ifdef FOG\nfog=v_fog;\n#endif\n#ifdef RENDER_CUTOFF\nfog*=v_cutoff_opacity;\n#endif\nglFragColor=vec4(vec3(0.0),mix(1.0,d,effect_intensity*u_opacity*fog));\n#else\nvec4 color=mix(vec4(u_flood_light_color,1.0),vec4(vec3(0.0),1.0),u_ao_pass);\n#ifdef OVERDRAW_INSPECTOR\ncolor=vec4(1.0);\n#endif\nglFragColor=color;\n#endif\nHANDLE_WIREFRAME_DEBUG;\n#endif\n}",'#include "_prelude_fog.vertex.glsl"\nin highp vec4 a_pos_end;in highp float a_angular_offset_factor;in highp float a_hidden_by_landmark;\n#ifdef SDF_SUBPASS\nout highp vec2 v_pos;out highp vec4 v_line_segment;out highp float v_flood_light_radius_tile;out highp vec2 v_ao;\n#ifdef FOG\nout highp float v_fog;\n#endif\n#endif\nuniform highp float u_flood_light_intensity;uniform highp mat4 u_matrix;uniform highp float u_ao_pass;uniform highp float u_meter_to_tile;uniform highp float u_edge_radius;uniform highp vec2 u_ao;\n#pragma mapbox: define highp float flood_light_ground_radius\nconst float TANGENT_CUTOFF=4.0;const float NORM=32767.0;void main() {\n#pragma mapbox: initialize highp float flood_light_ground_radius\nvec2 p=a_pos_end.xy;vec2 q=floor(a_pos_end.zw*0.5);vec2 start_bottom=a_pos_end.zw-q*2.0;float fl_ground_radius=flood_light_ground_radius;fl_ground_radius=abs(flood_light_ground_radius);float direction=flood_light_ground_radius < 0.0 ?-1.0 : 1.0;float flood_radius_tile=fl_ground_radius*u_meter_to_tile;vec2 v=normalize(q-p);float ao_radius=u_ao.y/3.5;float effect_radius=mix(flood_radius_tile,ao_radius,u_ao_pass)+u_edge_radius;float angular_offset_factor=a_angular_offset_factor/NORM*TANGENT_CUTOFF;float angular_offset=direction*angular_offset_factor*effect_radius;float top=1.0-start_bottom.y;float side=(0.5-start_bottom.x)*2.0;vec2 extrusion_parallel=v*side*mix(1.0,angular_offset,top);vec2 perp=vec2(v.y,-v.x);vec2 extrusion_perp=direction*perp*effect_radius*top;vec3 pos=vec3(mix(q,p,start_bottom.x),0.0);pos.xy+=extrusion_parallel+extrusion_perp;\n#ifdef SDF_SUBPASS\nv_pos=pos.xy;v_line_segment=vec4(p,q)+perp.xyxy*u_edge_radius;v_flood_light_radius_tile=flood_radius_tile;v_ao=vec2(u_ao.x,ao_radius);\n#ifdef FOG\nv_fog_pos=fog_position(pos);v_fog=1.0-fog(v_fog_pos);\n#endif\n#endif\nfloat hidden_by_landmark=0.0;\n#ifdef HAS_CENTROID\nhidden_by_landmark=a_hidden_by_landmark;\n#endif\nfloat isFloodlit=float(fl_ground_radius > 0.0 && u_flood_light_intensity > 0.0);float hidden=mix(1.0-isFloodlit,isFloodlit,u_ao_pass);hidden+=hidden_by_landmark;gl_Position=mix(u_matrix*vec4(pos,1.0),AWAY,float(hidden > 0.0));\n#ifdef RENDER_CUTOFF\nv_cutoff_opacity=cutoff_opacity(u_cutoff_params,gl_Position.z);\n#endif\n}'),hillshadePrepare:Pt("precision highp float;uniform sampler2D u_image;in vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;float getElevation(vec2 coord) {return texture(u_image,coord).r/4.0;}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y));float b=getElevation(v_pos+vec2(0,-epsilon.y));float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y));float d=getElevation(v_pos+vec2(-epsilon.x,0));float e=getElevation(v_pos+vec2(epsilon.x,0));float f=getElevation(v_pos+vec2(-epsilon.x,epsilon.y));float g=getElevation(v_pos+vec2(0,epsilon.y));float h=getElevation(v_pos+vec2(epsilon.x,epsilon.y));float exaggerationFactor=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;float exaggeration=u_zoom < 15.0 ? (u_zoom-15.0)*exaggerationFactor : 0.0;vec2 deriv=vec2(\n(c+e+e+h)-(a+d+d+f),(f+g+g+h)-(a+b+b+c)\n)/pow(2.0,exaggeration+(19.2562-u_zoom));glFragColor=clamp(vec4(\nderiv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0);}","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:Pt('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\nuniform sampler2D u_image;in vec2 v_pos;uniform vec2 u_latrange;uniform vec2 u_light;uniform vec4 u_shadow;uniform vec4 u_highlight;uniform vec4 u_accent;uniform float u_emissive_strength;void main() {vec4 pixel=texture(u_image,v_pos);vec2 deriv=((pixel.rg*2.0)-1.0);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));float slope=atan(1.25*length(deriv)/scaleFactor);float aspect=deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);float intensity=u_light.x;float azimuth=u_light.y+PI;float base=1.875-intensity*1.75;float maxValue=0.5*PI;float scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);float shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);vec4 shade_color=mix(u_shadow,u_highlight,shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);glFragColor=accent_color*(1.0-shade_color.a)+shade_color;\n#ifdef LIGHTING_3D_MODE\nglFragColor=apply_lighting_with_emission_ground(glFragColor,u_emissive_strength);\n#endif\n#ifdef FOG\nglFragColor=fog_dither(fog_apply_premultiplied(glFragColor,v_fog_pos));\n#endif\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\nuniform mat4 u_matrix;in vec2 a_pos;in vec2 a_texture_pos;out vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=a_texture_pos/8192.0;\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n}'),line:Pt('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\nuniform lowp float u_device_pixel_ratio;uniform float u_alpha_discard_threshold;uniform highp vec2 u_trim_offset;uniform highp vec2 u_trim_fade_range;uniform lowp vec4 u_trim_color;in vec2 v_width2;in vec2 v_normal;in float v_gamma_scale;in highp vec4 v_uv;\n#ifdef RENDER_LINE_DASH\nuniform sampler2D u_dash_image;in vec2 v_tex;\n#endif\n#ifdef RENDER_LINE_GRADIENT\nuniform sampler2D u_gradient_image;\n#endif\nfloat luminance(vec3 c) {return (c.r+c.r+c.b+c.g+c.g+c.g)*0.1667;}uniform float u_emissive_strength;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define lowp vec4 dash\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float border_width\n#pragma mapbox: define lowp vec4 border_color\nfloat linearstep(float edge0,float edge1,float x) {return clamp((x-edge0)/(edge1-edge0),0.0,1.0);}void main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize lowp vec4 dash\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float border_width\n#pragma mapbox: initialize lowp vec4 border_color\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);\n#ifdef RENDER_LINE_DASH\nfloat sdfdist=texture(u_dash_image,v_tex).r;float sdfgamma=1.0/(2.0*u_device_pixel_ratio)/dash.z;alpha*=linearstep(0.5-sdfgamma/floorwidth,0.5+sdfgamma/floorwidth,sdfdist);\n#endif\nhighp vec4 out_color;\n#ifdef RENDER_LINE_GRADIENT\nout_color=texture(u_gradient_image,v_uv.xy);\n#else\nout_color=color;\n#endif\nfloat trim_alpha=1.0;\n#ifdef RENDER_LINE_TRIM_OFFSET\nhighp float start=v_uv[2];highp float end=v_uv[3];highp float trim_start=u_trim_offset[0];highp float trim_end=u_trim_offset[1];highp float line_progress=(start+(v_uv.x)*(end-start));if (trim_end > trim_start) {highp float start_transition=max(0.0,min(1.0,(line_progress-trim_start)/max(u_trim_fade_range[0],1.0e-9)));highp float end_transition=max(0.0,min(1.0,(trim_end-line_progress)/max(u_trim_fade_range[1],1.0e-9)));highp float transition_factor=min(start_transition,end_transition);out_color=mix(out_color,u_trim_color,transition_factor);trim_alpha=out_color.a;}\n#endif\nif (u_alpha_discard_threshold !=0.0) {if (alpha < u_alpha_discard_threshold) {discard;}}\n#ifdef RENDER_LINE_BORDER\nfloat edgeBlur=(border_width+1.0/u_device_pixel_ratio);float alpha2=clamp(min(dist-(v_width2.t-edgeBlur),v_width2.s-dist)/edgeBlur,0.0,1.0);if (alpha2 < 1.) {float smoothAlpha=smoothstep(0.6,1.0,alpha2);if (border_color.a==0.0) {float Y=(out_color.a > 0.01) ? luminance(out_color.rgb/out_color.a) : 1.;float adjustment=(Y > 0.) ? 0.5/Y : 0.45;if (out_color.a > 0.25 && Y < 0.25) {vec3 borderColor=(Y > 0.) ? out_color.rgb : vec3(1,1,1)*out_color.a;out_color.rgb=out_color.rgb+borderColor*(adjustment*(1.0-smoothAlpha));} else {out_color.rgb*=(0.6 +0.4*smoothAlpha);}} else {out_color.rgb=mix(border_color.rgb*border_color.a*trim_alpha,out_color.rgb,smoothAlpha);}}\n#endif\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting_with_emission_ground(out_color,u_emissive_strength);\n#endif\n#ifdef FOG\nout_color=fog_dither(fog_apply_premultiplied(out_color,v_fog_pos));\n#endif\nout_color*=(alpha*opacity);\n#ifdef INDICATOR_CUTOUT\nout_color=applyCutout(out_color);\n#endif\nglFragColor=out_color;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_terrain.vertex.glsl"\n#define EXTRUDE_SCALE 0.015873016\nin vec2 a_pos_normal;in vec4 a_data;\n#if defined(ELEVATED)\nin float a_z_offset;\n#endif\n#if defined(RENDER_LINE_GRADIENT) || defined(RENDER_LINE_TRIM_OFFSET)\nin highp vec4 a_packed;\n#endif\n#ifdef RENDER_LINE_DASH\nin float a_linesofar;\n#endif\nuniform mat4 u_matrix;uniform mat2 u_pixels_to_tile_units;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 vec4 v_uv;\n#ifdef RENDER_LINE_DASH\nuniform vec2 u_texsize;uniform float u_tile_units_to_pixels;out vec2 v_tex;\n#endif\n#ifdef RENDER_LINE_GRADIENT\nuniform float u_image_height;\n#endif\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define lowp vec4 dash\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float border_width\n#pragma mapbox: define lowp vec4 border_color\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize lowp vec4 dash\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float border_width\n#pragma mapbox: initialize lowp vec4 border_color\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*EXTRUDE_SCALE;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*EXTRUDE_SCALE*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist*u_pixels_to_tile_units,0.0,0.0);\n#if defined(ELEVATED)\nvec2 offsetTile=offset2*u_pixels_to_tile_units;vec2 halfCellProgress=normal.yx*32.0;float ele0=elevation(pos);float ele_line=max(ele0,max(elevation(pos+halfCellProgress),elevation(pos-halfCellProgress)));float ele1=elevation(pos+offsetTile);float ele2=elevation(pos-offsetTile);float ele_max=max(ele_line,0.5*(ele1+ele2));float ele=ele_max-ele0+ele1+a_z_offset ;gl_Position=u_matrix*vec4(pos+offsetTile,ele,1.0)+projected_extrude;float z=clamp(gl_Position.z/gl_Position.w,0.5,1.0);float zbias=max(0.00005,(pow(z,0.8)-z)*0.1*u_exaggeration);gl_Position.z-=(gl_Position.w*zbias);\n#else\ngl_Position=u_matrix*vec4(pos+offset2*u_pixels_to_tile_units,0.0,1.0)+projected_extrude;\n#endif\n#ifndef RENDER_TO_TEXTURE\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\n#else\nv_gamma_scale=1.0;\n#endif\n#if defined(RENDER_LINE_GRADIENT) || defined(RENDER_LINE_TRIM_OFFSET)\nfloat a_uv_x=a_packed[0];float a_split_index=a_packed[1];highp float a_clip_start=a_packed[2];highp float a_clip_end=a_packed[3];\n#ifdef RENDER_LINE_GRADIENT\nhighp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec4(a_uv_x,a_split_index*texel_height-half_texel_height,a_clip_start,a_clip_end);\n#else\nv_uv=vec4(a_uv_x,0.0,a_clip_start,a_clip_end);\n#endif\n#endif\n#ifdef RENDER_LINE_DASH\nfloat scale=dash.z==0.0 ? 0.0 : u_tile_units_to_pixels/dash.z;float height=dash.y;v_tex=vec2(a_linesofar*scale/floorwidth,(-normal.y*height+dash.x+0.5)/u_texsize.y);\n#endif\nv_width2=vec2(outset,inset);\n#ifdef FOG\nv_fog_pos=fog_position(pos);\n#endif\n}'),linePattern:Pt('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\nuniform highp float u_device_pixel_ratio;uniform highp float u_alpha_discard_threshold;uniform highp vec2 u_texsize;uniform highp float u_tile_units_to_pixels;uniform highp vec2 u_trim_offset;uniform sampler2D u_image;in vec2 v_normal;in vec2 v_width2;in highp float v_linesofar;in float v_gamma_scale;in float v_width;\n#ifdef RENDER_LINE_TRIM_OFFSET\nin highp vec4 v_uv;\n#endif\n#ifdef LINE_JOIN_NONE\nin vec2 v_pattern_data;\n#endif\n#pragma mapbox: define mediump vec4 pattern\n#pragma mapbox: define mediump float pixel_ratio\n#pragma mapbox: define mediump float blur\n#pragma mapbox: define mediump float opacity\nvoid main() {\n#pragma mapbox: initialize mediump vec4 pattern\n#pragma mapbox: initialize mediump float pixel_ratio\n#pragma mapbox: initialize mediump float blur\n#pragma mapbox: initialize mediump float opacity\nvec2 pattern_tl=pattern.xy;vec2 pattern_br=pattern.zw;vec2 display_size=(pattern_br-pattern_tl)/pixel_ratio;float pattern_size=display_size.x/u_tile_units_to_pixels;float aspect=display_size.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);highp float pattern_x=v_linesofar/pattern_size*aspect;float x=mod(pattern_x,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos=mix(pattern_tl*texel_size-texel_size,pattern_br*texel_size+texel_size,vec2(x,y));vec2 lod_pos=mix(pattern_tl*texel_size-texel_size,pattern_br*texel_size+texel_size,vec2(pattern_x,y));vec4 color=textureLodCustom(u_image,pos,lod_pos);\n#ifdef RENDER_LINE_TRIM_OFFSET\nhighp float start=v_uv[2];highp float end=v_uv[3];highp float trim_start=u_trim_offset[0];highp float trim_end=u_trim_offset[1];highp float line_progress=(start+(v_uv.x)*(end-start));if (trim_end > trim_start) {if (line_progress <=trim_end && line_progress >=trim_start) {color=vec4(0,0,0,0);}}\n#endif\n#ifdef LINE_JOIN_NONE\nfloat pattern_len=pattern_size/aspect;float segment_phase=pattern_len-mod(v_linesofar-v_pattern_data.x+pattern_len,pattern_len);float visible_start=segment_phase-step(pattern_len*0.5,segment_phase)*pattern_len;float visible_end=floor((v_pattern_data.y-segment_phase)/pattern_len)*pattern_len+segment_phase;visible_end+=step(pattern_len*0.5,v_pattern_data.y-visible_end)*pattern_len;if (v_pattern_data.x < visible_start || v_pattern_data.x >=visible_end) {color=vec4(0.0);}\n#endif\n#ifdef LIGHTING_3D_MODE\ncolor=apply_lighting_ground(color);\n#endif\n#ifdef FOG\ncolor=fog_dither(fog_apply_premultiplied(color,v_fog_pos));\n#endif\ncolor*=(alpha*opacity);if (u_alpha_discard_threshold !=0.0) {if (color.a < u_alpha_discard_threshold) {discard;}}\n#ifdef INDICATOR_CUTOUT\ncolor=applyCutout(color);\n#endif\nglFragColor=color;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_terrain.vertex.glsl"\n#define scale 0.015873016\nin vec2 a_pos_normal;in vec4 a_data;\n#if defined(ELEVATED)\nin float a_z_offset;\n#endif\n#ifdef RENDER_LINE_TRIM_OFFSET\nin highp vec4 a_packed;\n#endif\nin highp float a_linesofar;\n#ifdef LINE_JOIN_NONE\nin highp vec3 a_pattern_data;out vec2 v_pattern_data;\n#endif\nuniform mat4 u_matrix;uniform float u_tile_units_to_pixels;uniform vec2 u_units_to_pixels;uniform mat2 u_pixels_to_tile_units;uniform float u_device_pixel_ratio;out vec2 v_normal;out vec2 v_width2;out highp float v_linesofar;out float v_gamma_scale;out float v_width;\n#ifdef RENDER_LINE_TRIM_OFFSET\nout highp vec4 v_uv;\n#endif\n#pragma mapbox: define mediump float blur\n#pragma mapbox: define mediump float opacity\n#pragma mapbox: define mediump float offset\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define mediump float width\n#pragma mapbox: define mediump float floorwidth\n#pragma mapbox: define mediump vec4 pattern\n#pragma mapbox: define mediump float pixel_ratio\nvoid main() {\n#pragma mapbox: initialize mediump float blur\n#pragma mapbox: initialize mediump float opacity\n#pragma mapbox: initialize mediump float offset\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize mediump float floorwidth\n#pragma mapbox: initialize mediump vec4 pattern\n#pragma mapbox: initialize mediump float pixel_ratio\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;vec2 pos=floor(a_pos_normal*0.5);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);vec2 dist=outset*a_extrude*scale;float u=0.5*a_direction;float t=1.0-abs(u);vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist*u_pixels_to_tile_units,0.0,0.0);\n#if defined(ELEVATED)\nvec2 offsetTile=offset2*u_pixels_to_tile_units;vec2 halfCellProgress=normal.yx*32.0;float ele0=elevation(pos);float ele_line=max(ele0,max(elevation(pos+halfCellProgress),elevation(pos-halfCellProgress)));float ele1=elevation(pos+offsetTile);float ele2=elevation(pos-offsetTile);float ele_max=max(ele_line,0.5*(ele1+ele2));float ele=ele_max-ele0+ele1+a_z_offset ;gl_Position=u_matrix*vec4(pos+offsetTile,ele,1.0)+projected_extrude;float z=clamp(gl_Position.z/gl_Position.w,0.5,1.0);float zbias=max(0.00005,(pow(z,0.8)-z)*0.1*u_exaggeration);gl_Position.z-=(gl_Position.w*zbias);\n#else\ngl_Position=u_matrix*vec4(pos+offset2*u_pixels_to_tile_units,0.0,1.0)+projected_extrude;\n#endif\n#ifndef RENDER_TO_TEXTURE\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\n#else\nv_gamma_scale=1.0;\n#endif\n#ifdef RENDER_LINE_TRIM_OFFSET\nfloat a_uv_x=a_packed[0];highp float a_clip_start=a_packed[2];highp float a_clip_end=a_packed[3];v_uv=vec4(a_uv_x,0.0,a_clip_start,a_clip_end);\n#endif\nv_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;\n#ifdef LINE_JOIN_NONE\nv_width=floorwidth+ANTIALIASING;mediump float pixels_to_tile_units=1.0/u_tile_units_to_pixels;mediump float pixel_ratio_inverse=1.0/pixel_ratio;mediump float aspect=v_width/((pattern.w-pattern.y)*pixel_ratio_inverse);highp float subt_multiple=(pattern.z-pattern.x)*pixel_ratio_inverse*pixels_to_tile_units*aspect*32.0;highp float subt=floor(a_pattern_data.z/subt_multiple)*subt_multiple;float offset_sign=(fract(a_pattern_data.x)-0.5)*4.0;float line_progress_offset=offset_sign*v_width*0.5*pixels_to_tile_units;v_linesofar=(a_pattern_data.z-subt)+a_linesofar+line_progress_offset;v_pattern_data=vec2(a_pattern_data.x+line_progress_offset,a_pattern_data.y);\n#endif\n#ifdef FOG\nv_fog_pos=fog_position(pos);\n#endif\n}'),raster:Pt('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\n#include "_prelude_raster_array.glsl"\nuniform float u_fade_t;uniform float u_opacity;uniform highp float u_raster_elevation;uniform highp float u_zoom_transition;in vec2 v_pos0;in vec2 v_pos1;in float v_depth;\n#ifdef PROJECTION_GLOBE_VIEW\nin float v_split_fade;\n#endif\nuniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;uniform float u_emissive_strength;\n#ifndef RASTER_ARRAY\nuniform sampler2D u_image0;uniform sampler2D u_image1;\n#endif\n#ifdef RASTER_COLOR\nuniform sampler2D u_color_ramp;uniform highp vec4 u_colorization_mix;uniform highp float u_colorization_offset;uniform vec2 u_texture_res;\n#endif\nvoid main() {vec4 color0,color1,color;vec2 value;\n#ifdef RASTER_COLOR\n#ifdef RASTER_ARRAY\n#ifdef RASTER_ARRAY_LINEAR\nvalue=mix(\nraTexture2D_image0_linear(v_pos0,u_texture_res,u_colorization_mix,u_colorization_offset),raTexture2D_image1_linear(v_pos1,u_texture_res,u_colorization_mix,u_colorization_offset),u_fade_t\n);\n#else\nvalue=mix(\nraTexture2D_image0_nearest(v_pos0,u_texture_res,u_colorization_mix,u_colorization_offset),raTexture2D_image1_nearest(v_pos1,u_texture_res,u_colorization_mix,u_colorization_offset),u_fade_t\n);\n#endif\nif (value.y > 0.0) value.x/=value.y;\n#else\ncolor=mix(texture(u_image0,v_pos0),texture(u_image1,v_pos1),u_fade_t);value=vec2(u_colorization_offset+dot(color.rgb,u_colorization_mix.rgb),color.a);\n#endif\ncolor=texture(u_color_ramp,vec2(value.x,0.5));if (color.a > 0.0) color.rgb/=color.a;color.a*=value.y;\n#else\ncolor0=texture(u_image0,v_pos0);color1=texture(u_image1,v_pos1);if (color0.a > 0.0) color0.rgb/=color0.a;if (color1.a > 0.0) color1.rgb/=color1.a;color=mix(color0,color1,u_fade_t);\n#endif\ncolor.a*=u_opacity;\n#ifdef GLOBE_POLES\ncolor.a*=1.0-smoothstep(0.0,0.05,u_zoom_transition);\n#endif\nvec3 rgb=color.rgb;rgb=vec3(\ndot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;rgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);vec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);vec3 out_color=mix(u_high_vec,u_low_vec,rgb);\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting_with_emission_ground(vec4(out_color,1.0),u_emissive_strength).rgb;\n#endif\n#ifdef FOG\nhighp float fog_limit_high_meters=1000000.0;highp float fog_limit_low_meters=600000.0;float fog_limit=1.0-smoothstep(fog_limit_low_meters,fog_limit_high_meters,u_raster_elevation);out_color=fog_dither(fog_apply(out_color,v_fog_pos,fog_limit));\n#endif\nglFragColor=vec4(out_color*color.a,color.a);\n#ifdef PROJECTION_GLOBE_VIEW\nglFragColor*=mix(1.0,1.0-smoothstep(0.0,0.05,u_zoom_transition),smoothstep(0.8,0.9,v_split_fade));\n#endif\n#ifdef RENDER_CUTOFF\nglFragColor=glFragColor*cutoff_opacity(u_cutoff_params,v_depth);\n#endif\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\nuniform mat4 u_matrix;uniform mat4 u_normalize_matrix;uniform mat4 u_globe_matrix;uniform mat4 u_merc_matrix;uniform mat3 u_grid_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform vec2 u_perspective_transform;uniform vec2 u_texture_offset;uniform float u_raster_elevation;uniform float u_zoom_transition;uniform vec2 u_merc_center;\n#define GLOBE_UPSCALE GLOBE_RADIUS/6371008.8\n#ifdef GLOBE_POLES\nin vec3 a_globe_pos;in vec2 a_uv;\n#else\nin vec2 a_pos;in vec2 a_texture_pos;\n#endif\nout vec2 v_pos0;out vec2 v_pos1;out float v_depth;\n#ifdef PROJECTION_GLOBE_VIEW\nout float v_split_fade;\n#endif\nvoid main() {vec2 uv;\n#ifdef GLOBE_POLES\nvec3 globe_pos=a_globe_pos;globe_pos+=normalize(globe_pos)*u_raster_elevation*GLOBE_UPSCALE;gl_Position=u_matrix*u_globe_matrix*vec4(globe_pos ,1.0);uv=a_uv;\n#ifdef FOG\nv_fog_pos=fog_position((u_normalize_matrix*vec4(a_globe_pos,1.0)).xyz);\n#endif\n#else\nfloat w=1.0+dot(a_texture_pos,u_perspective_transform);uv=a_texture_pos/8192.0;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 decomposed_pos_and_skirt=decomposeToPosAndSkirt(a_pos);vec3 latLng=u_grid_matrix*vec3(decomposed_pos_and_skirt.xy,1.0);vec3 globe_pos=latLngToECEF(latLng.xy);globe_pos+=normalize(globe_pos)*u_raster_elevation*GLOBE_UPSCALE;vec4 globe_world_pos=u_globe_matrix*vec4(globe_pos,1.0);vec4 merc_world_pos=vec4(0.0);float mercatorY=mercatorYfromLat(latLng[0]);float mercatorX=mercatorXfromLng(latLng[1]); \nv_split_fade=0.0;if (u_zoom_transition > 0.0) {vec2 merc_pos=vec2(mercatorX,mercatorY);merc_world_pos=vec4(merc_pos,u_raster_elevation,1.0);merc_world_pos.xy-=u_merc_center;merc_world_pos.x=wrap(merc_world_pos.x,-0.5,0.5);merc_world_pos=u_merc_matrix*merc_world_pos;float opposite_merc_center=mod(u_merc_center.x+0.5,1.0);float dist_from_poles=(abs(mercatorY-0.5)*2.0);float range=0.1;v_split_fade=abs(opposite_merc_center-mercatorX);v_split_fade=clamp(1.0-v_split_fade,0.0,1.0);v_split_fade=max(smoothstep(1.0-range,1.0,dist_from_poles),max(smoothstep(1.0-range,1.0,v_split_fade),smoothstep(1.0-range,1.0,1.0-v_split_fade)));}float tiles=u_grid_matrix[0][2];if (tiles > 0.0) {float idx=u_grid_matrix[1][2];float idy=u_grid_matrix[2][2];float uvY=mercatorY*tiles-idy;float uvX=mercatorX*tiles-idx;uv=vec2(uvX,uvY);}vec4 interpolated_pos=vec4(mix(globe_world_pos.xyz,merc_world_pos.xyz,u_zoom_transition)*w,w);gl_Position=u_matrix*interpolated_pos;\n#ifdef FOG\nv_fog_pos=fog_position((u_normalize_matrix*vec4(globe_pos,1.0)).xyz);\n#endif\n#else\ngl_Position=u_matrix*vec4(a_pos*w,u_raster_elevation*w,w);\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n#endif\n#endif\nv_pos0=uv;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;v_pos0=u_texture_offset.x+u_texture_offset.y*v_pos0;v_pos1=u_texture_offset.x+u_texture_offset.y*v_pos1;\n#ifdef RENDER_CUTOFF\nv_depth=gl_Position.z;\n#endif\n}'),rasterParticle:Pt('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\nuniform float u_fade_t;uniform float u_opacity;uniform highp float u_raster_elevation;in vec2 v_pos0;in vec2 v_pos1;uniform sampler2D u_image0;uniform sampler2D u_image1;void main() {vec4 color0,color1,color;color0=texture(u_image0,v_pos0);color1=texture(u_image1,v_pos1);if (color0.a > 0.0) color0.rgb/=color0.a;if (color1.a > 0.0) color1.rgb/=color1.a;color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 out_color=color.rgb;\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting_with_emission_ground(vec4(out_color,1.0),0.0).rgb;\n#endif\n#ifdef FOG\nhighp float fog_limit_high_meters=1000000.0;highp float fog_limit_low_meters=600000.0;float fog_limit=1.0-smoothstep(fog_limit_low_meters,fog_limit_high_meters,u_raster_elevation);out_color=fog_dither(fog_apply(out_color,v_fog_pos,fog_limit));\n#endif\nglFragColor=vec4(out_color*color.a,color.a);\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\nuniform mat4 u_matrix;uniform mat4 u_normalize_matrix;uniform mat4 u_globe_matrix;uniform mat4 u_merc_matrix;uniform mat3 u_grid_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_raster_elevation;uniform float u_zoom_transition;uniform vec2 u_merc_center;\n#define GLOBE_UPSCALE GLOBE_RADIUS/6371008.8\nin vec2 a_pos;in vec2 a_texture_pos;out vec2 v_pos0;out vec2 v_pos1;void main() {float w=1.0;vec2 uv;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 decomposed_pos_and_skirt=decomposeToPosAndSkirt(a_pos);vec3 latLng=u_grid_matrix*vec3(decomposed_pos_and_skirt.xy,1.0);float mercatorY=mercatorYfromLat(latLng[0]);float mercatorX=mercatorXfromLng(latLng[1]);float tiles=u_grid_matrix[0][2];float idx=u_grid_matrix[1][2];float idy=u_grid_matrix[2][2];float uvX=mercatorX*tiles-idx;float uvY=mercatorY*tiles-idy;uv=vec2(uvX,uvY);vec3 globe_pos=latLngToECEF(latLng.xy);globe_pos+=normalize(globe_pos)*u_raster_elevation*GLOBE_UPSCALE;vec4 globe_world_pos=u_globe_matrix*vec4(globe_pos,1.0);vec4 merc_world_pos=vec4(0.0);if (u_zoom_transition > 0.0) {vec2 merc_pos=vec2(mercatorX,mercatorY);merc_world_pos=vec4(merc_pos,u_raster_elevation,1.0);merc_world_pos.xy-=u_merc_center;merc_world_pos.x=wrap(merc_world_pos.x,-0.5,0.5);merc_world_pos=u_merc_matrix*merc_world_pos;}vec4 interpolated_pos=vec4(mix(globe_world_pos.xyz,merc_world_pos.xyz,u_zoom_transition)*w,w);gl_Position=u_matrix*interpolated_pos;\n#ifdef FOG\nv_fog_pos=fog_position((u_normalize_matrix*vec4(globe_pos,1.0)).xyz);\n#endif\n#else\nuv=a_texture_pos/8192.0;gl_Position=u_matrix*vec4(a_pos*w,u_raster_elevation*w,w);\n#ifdef FOG\nv_fog_pos=fog_position(a_pos);\n#endif\n#endif\nv_pos0=uv;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}'),rasterParticleDraw:Pt("uniform sampler2D u_color_ramp;in float v_particle_speed;void main() {glFragColor=texture(u_color_ramp,vec2(v_particle_speed,0.5));}",'#include "_prelude_raster_particle.glsl"\nin float a_index;uniform sampler2D u_particle_texture;uniform float u_particle_texture_side_len;uniform vec2 u_tile_offset;out float v_particle_speed;void main() {ivec2 pixel_coord=ivec2(\nmod(a_index,u_particle_texture_side_len),a_index/u_particle_texture_side_len);vec4 pixel=texelFetch(u_particle_texture,pixel_coord,0);vec2 pos=unpack_pos_from_rgba(pixel)+u_tile_offset;vec2 tex_coord=fract(pos);vec2 velocity=lookup_velocity(tex_coord);if (velocity==INVALID_VELOCITY) {gl_Position=AWAY;v_particle_speed=0.0;} else {gl_Position=vec4(2.0*pos-1.0,0,1);v_particle_speed=length(velocity);}gl_PointSize=1.0;}'),rasterParticleTexture:Pt("uniform sampler2D u_texture;uniform float u_opacity;in vec2 v_tex_pos;void main() {vec4 color=texture(u_texture,v_tex_pos);glFragColor=vec4(floor(255.0*color*u_opacity)/255.0);}","in vec2 a_pos;out vec2 v_tex_pos;void main() {vec2 uv=0.5*a_pos+vec2(0.5);v_tex_pos=uv;gl_Position=vec4(a_pos,0.0,1.0);}"),rasterParticleUpdate:Pt('#include "_prelude_raster_particle.glsl"\nuniform sampler2D u_particle_texture;uniform mediump float u_particle_texture_side_len;uniform mediump float u_speed_factor;uniform highp float u_reset_rate;uniform highp float u_rand_seed;in highp vec2 v_tex_coord;vec2 linearstep(vec2 edge0,vec2 edge1,vec2 x) {return clamp((x-edge0)/(edge1-edge0),vec2(0),vec2(1));}const highp vec3 rand_constants=vec3(12.9898,78.233,4375.85453);highp float rand(const highp vec2 co) {highp float t=dot(rand_constants.xy,co);return fract(sin(t)*(rand_constants.z+t));}void main() {ivec2 pixel_coord=ivec2(v_tex_coord*u_particle_texture_side_len);highp vec4 pixel=texelFetch(u_particle_texture,pixel_coord,0);highp vec2 pos=unpack_pos_from_rgba(pixel);highp vec2 velocity=lookup_velocity(clamp(pos,0.0,1.0));highp vec2 dp=velocity==INVALID_VELOCITY ? vec2(0) : velocity*u_speed_factor;pos=pos+dp;highp vec2 seed=(pos+v_tex_coord)*u_rand_seed;highp vec2 random_pos=vec2(rand(seed+1.3),rand(seed+2.1));highp vec2 persist_rate=pow(\nlinearstep(vec2(-u_particle_pos_offset),vec2(0),pos)*linearstep(vec2(1.0+u_particle_pos_offset),vec2(1),pos),vec2(4)\n);highp vec2 per_frame_persist=pow(persist_rate,abs(dp)/u_particle_pos_offset);highp float drop_rate=1.0-per_frame_persist.x*per_frame_persist.y;drop_rate=any(greaterThanEqual(abs(pos-0.5),vec2(0.5+u_particle_pos_offset))) ? 1.0 : drop_rate;highp float drop=step(1.0-drop_rate-u_reset_rate,rand(seed));highp vec2 next_pos=mix(pos,random_pos,drop);glFragColor=pack_pos_to_rgba(next_pos);}',"in vec2 a_pos;out vec2 v_tex_coord;void main() {v_tex_coord=0.5*(a_pos+vec2(1.0));gl_Position=vec4(a_pos,0.0,1.0);}"),symbolIcon:Pt('#include "_prelude_lighting.glsl"\nuniform sampler2D u_texture;\n#ifdef ICON_TRANSITION\nuniform float u_icon_transition;\n#endif\nin float v_fade_opacity;in vec2 v_tex_a;\n#ifdef ICON_TRANSITION\nin vec2 v_tex_b;\n#endif\n#ifdef COLOR_ADJUSTMENT\nuniform mat4 u_color_adj_mat;\n#endif\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float emissive_strength\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float emissive_strength\nlowp float alpha=opacity*v_fade_opacity;vec4 out_color;\n#ifdef ICON_TRANSITION\nvec4 a=texture(u_texture,v_tex_a)*(1.0-u_icon_transition);vec4 b=texture(u_texture,v_tex_b)*u_icon_transition;out_color=(a+b);\n#else\nout_color=texture(u_texture,v_tex_a);\n#endif\n#ifdef COLOR_ADJUSTMENT\nout_color=u_color_adj_mat*out_color;\n#endif\nout_color*=alpha;\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting_with_emission_ground(out_color,emissive_strength);\n#endif\nglFragColor=out_color;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_terrain.vertex.glsl"\nin vec4 a_pos_offset;in vec4 a_tex_size;in vec4 a_pixeloffset;in vec4 a_projected_pos;in float a_fade_opacity;\n#ifdef OCCLUSION_QUERIES\nin float a_occlusion_query_opacity;\n#endif\n#ifdef Z_OFFSET\nin float a_z_offset;\n#endif\n#ifdef PROJECTION_GLOBE_VIEW\nin vec3 a_globe_anchor;in vec3 a_globe_normal;\n#endif\n#ifdef ICON_TRANSITION\nin vec2 a_texb;\n#endif\nuniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform float u_fade_change;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;uniform vec3 u_up_vector;\n#ifdef PROJECTION_GLOBE_VIEW\nuniform vec3 u_tile_id;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_camera_forward;uniform float u_zoom_transition;uniform vec3 u_ecef_origin;uniform mat4 u_tile_matrix;\n#endif\nout vec2 v_tex_a;\n#ifdef ICON_TRANSITION\nout vec2 v_tex_b;\n#endif\nout float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float emissive_strength\n#pragma mapbox: define lowp float occlusion_opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float emissive_strength\n#pragma mapbox: initialize lowp float occlusion_opacity\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_tex_size.xy;vec2 a_size=a_tex_size.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_min_font_scale=a_pixeloffset.zw/256.0;highp float segment_angle=-a_projected_pos[3];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 tile_anchor=a_pos;float e=elevation(tile_anchor);\n#ifdef Z_OFFSET\ne+=a_z_offset;\n#endif\nvec3 h=elevationVector(tile_anchor)*e;float globe_occlusion_fade;vec3 world_pos;vec3 mercator_pos;vec3 world_pos_globe;\n#ifdef PROJECTION_GLOBE_VIEW\nmercator_pos=mercator_tile_position(u_inv_rot_matrix,tile_anchor,u_tile_id,u_merc_center);world_pos_globe=a_globe_anchor+h;world_pos=mix_globe_mercator(world_pos_globe,mercator_pos,u_zoom_transition);vec4 ecef_point=u_tile_matrix*vec4(world_pos,1.0);vec3 origin_to_point=ecef_point.xyz-u_ecef_origin;globe_occlusion_fade=dot(origin_to_point,u_camera_forward) >=0.0 ? 0.0 : 1.0;\n#else\nworld_pos=vec3(tile_anchor,0)+h;globe_occlusion_fade=1.0;\n#endif\nvec4 projected_point=u_matrix*vec4(world_pos,1);highp float camera_to_anchor_distance=projected_point.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(\n0.5+0.5*distance_ratio,0.0,1.5);size*=perspective_ratio;float font_scale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjected_point;vec2 a;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 displacement=vec3(a_globe_normal.z,0,-a_globe_normal.x);offsetProjected_point=u_matrix*vec4(a_globe_anchor+displacement,1);vec4 projected_point_globe=u_matrix*vec4(world_pos_globe,1);a=projected_point_globe.xy/projected_point_globe.w;\n#else\noffsetProjected_point=u_matrix*vec4(tile_anchor+vec2(1,0),0,1);a=projected_point.xy/projected_point.w;\n#endif\nvec2 b=offsetProjected_point.xy/offsetProjected_point.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}vec4 projected_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 proj_pos=mix_globe_mercator(a_projected_pos.xyz+h,mercator_pos,u_zoom_transition);projected_pos=u_label_plane_matrix*vec4(proj_pos,1.0);\n#else\nprojected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,h.z,1.0);\n#endif\nhighp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);float z=0.0;vec2 offset=rotation_matrix*(a_offset/32.0*max(a_min_font_scale,font_scale)+a_pxoffset/16.0);\n#ifdef TERRAIN\n#ifdef PITCH_WITH_MAP_TERRAIN\nvec4 tile_pos=u_label_plane_matrix_inv*vec4(a_projected_pos.xy+offset,0.0,1.0);z=elevation(tile_pos.xy);\n#endif\n#endif\nfloat occlusion_fade=globe_occlusion_fade;float projection_transition_fade=1.0;\n#if defined(PROJECTED_POS_ON_VIEWPORT) && defined(PROJECTION_GLOBE_VIEW)\nprojection_transition_fade=1.0-step(EPSILON,u_zoom_transition);\n#endif\nvec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float out_fade_opacity=max(0.0,min(occlusion_fade,fade_opacity[0]+fade_change))*projection_transition_fade;float alpha=opacity*out_fade_opacity;float hidden=float(alpha==0.0 || projected_point.w <=0.0 || occlusion_fade==0.0);\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 xAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,u_up_vector)) : vec3(1,0,0);vec3 yAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,xAxis)) : vec3(0,1,0);gl_Position=mix(u_coord_matrix*vec4(projected_pos.xyz/projected_pos.w+xAxis*offset.x+yAxis*offset.y,1.0),AWAY,hidden);\n#else\ngl_Position=mix(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+offset,z,1.0),AWAY,hidden);\n#endif\nv_tex_a=a_tex/u_texsize;\n#ifdef ICON_TRANSITION\nv_tex_b=a_texb/u_texsize;\n#endif\nv_fade_opacity=out_fade_opacity;\n#ifdef DEPTH_OCCLUSION\nfloat depthOcclusion=occlusionFadeMultiSample(projected_point);float depthOcclusionMultplier=mix(occlusion_opacity,1.0,depthOcclusion);v_fade_opacity*=depthOcclusionMultplier;\n#endif\n#ifdef OCCLUSION_QUERIES\nfloat occludedFadeMultiplier=mix(occlusion_opacity,1.0,a_occlusion_query_opacity);v_fade_opacity*=occludedFadeMultiplier;\n#endif\n}'),symbolSDF:Pt('#include "_prelude_lighting.glsl"\n#define SDF_PX 8.0\nuniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;uniform bool u_is_halo;in float v_draw_halo;in vec2 v_data0;in vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\n#pragma mapbox: define lowp float emissive_strength\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\n#pragma mapbox: initialize lowp float emissive_strength\nfloat EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float fade_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;bool draw_halo=v_draw_halo > 0.0;if (draw_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).r;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);vec4 out_color=color*(alpha*opacity*fade_opacity);\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting_with_emission_ground(out_color,emissive_strength);\n#endif\nglFragColor=out_color;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_terrain.vertex.glsl"\nin vec4 a_pos_offset;in vec4 a_tex_size;in vec4 a_pixeloffset;in vec4 a_projected_pos;in float a_fade_opacity;\n#ifdef Z_OFFSET\nin float a_z_offset;\n#endif\n#ifdef PROJECTION_GLOBE_VIEW\nin vec3 a_globe_anchor;in vec3 a_globe_normal;\n#endif\n#ifdef OCCLUSION_QUERIES\nin float a_occlusion_query_opacity;\n#endif\nuniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec3 u_up_vector;uniform bool u_is_halo;\n#ifdef PROJECTION_GLOBE_VIEW\nuniform vec3 u_tile_id;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_camera_forward;uniform float u_zoom_transition;uniform vec3 u_ecef_origin;uniform mat4 u_tile_matrix;\n#endif\nout float v_draw_halo;out vec2 v_data0;out vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\n#pragma mapbox: define lowp float emissive_strength\n#pragma mapbox: define lowp float occlusion_opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\n#pragma mapbox: initialize lowp float emissive_strength\n#pragma mapbox: initialize lowp float occlusion_opacity\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_tex_size.xy;vec2 a_size=a_tex_size.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;highp float segment_angle=-a_projected_pos[3];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 tile_anchor=a_pos;float e=elevation(tile_anchor);\n#ifdef Z_OFFSET\ne+=a_z_offset;\n#endif\nvec3 h=elevationVector(tile_anchor)*e;float globe_occlusion_fade;vec3 world_pos;vec3 mercator_pos;vec3 world_pos_globe;\n#ifdef PROJECTION_GLOBE_VIEW\nmercator_pos=mercator_tile_position(u_inv_rot_matrix,tile_anchor,u_tile_id,u_merc_center);world_pos_globe=a_globe_anchor+h;world_pos=mix_globe_mercator(world_pos_globe,mercator_pos,u_zoom_transition);vec4 ecef_point=u_tile_matrix*vec4(world_pos,1.0);vec3 origin_to_point=ecef_point.xyz-u_ecef_origin;globe_occlusion_fade=dot(origin_to_point,u_camera_forward) >=0.0 ? 0.0 : 1.0;\n#else\nworld_pos=vec3(tile_anchor,0)+h;globe_occlusion_fade=1.0;\n#endif\nvec4 projected_point=u_matrix*vec4(world_pos,1);highp float camera_to_anchor_distance=projected_point.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(\n0.5+0.5*distance_ratio,0.0,1.5);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetprojected_point;vec2 a;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 displacement=vec3(a_globe_normal.z,0,-a_globe_normal.x);offsetprojected_point=u_matrix*vec4(a_globe_anchor+displacement,1);vec4 projected_point_globe=u_matrix*vec4(world_pos_globe,1);a=projected_point_globe.xy/projected_point_globe.w;\n#else\noffsetprojected_point=u_matrix*vec4(tile_anchor+vec2(1,0),0,1);a=projected_point.xy/projected_point.w;\n#endif\nvec2 b=offsetprojected_point.xy/offsetprojected_point.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}vec4 projected_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 proj_pos=mix_globe_mercator(a_projected_pos.xyz+h,mercator_pos,u_zoom_transition);projected_pos=u_label_plane_matrix*vec4(proj_pos,1.0);\n#else\nprojected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,h.z,1.0);\n#endif\nhighp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);float z=0.0;vec2 offset=rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset);\n#ifdef TERRAIN\n#ifdef PITCH_WITH_MAP_TERRAIN\nvec4 tile_pos=u_label_plane_matrix_inv*vec4(a_projected_pos.xy+offset,0.0,1.0);z=elevation(tile_pos.xy);\n#endif\n#endif\nfloat occlusion_fade=globe_occlusion_fade;float projection_transition_fade=1.0;\n#if defined(PROJECTED_POS_ON_VIEWPORT) && defined(PROJECTION_GLOBE_VIEW)\nprojection_transition_fade=1.0-step(EPSILON,u_zoom_transition);\n#endif\nvec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(occlusion_fade,fade_opacity[0]+fade_change));float out_fade_opacity=interpolated_fade_opacity*projection_transition_fade;\n#ifdef DEPTH_OCCLUSION\nfloat depthOcclusion=occlusionFadeMultiSample(projected_point);float depthOcclusionMultplier=mix(occlusion_opacity,1.0,depthOcclusion);out_fade_opacity*=depthOcclusionMultplier;\n#endif\n#ifdef OCCLUSION_QUERIES\nfloat occludedFadeMultiplier=mix(occlusion_opacity,1.0,a_occlusion_query_opacity);out_fade_opacity*=occludedFadeMultiplier;\n#endif\nfloat alpha=opacity*out_fade_opacity;float hidden=float(alpha==0.0 || projected_point.w <=0.0 || occlusion_fade==0.0);\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 xAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,u_up_vector)) : vec3(1,0,0);vec3 yAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,xAxis)) : vec3(0,1,0);gl_Position=mix(u_coord_matrix*vec4(projected_pos.xyz/projected_pos.w+xAxis*offset.x+yAxis*offset.y,1.0),AWAY,hidden);\n#else\ngl_Position=mix(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+offset,z,1.0),AWAY,hidden);\n#endif\nfloat gamma_scale=gl_Position.w;v_draw_halo=(u_is_halo && float(gl_InstanceID)==0.0) ? 1.0 : 0.0;v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,out_fade_opacity);}'),symbolTextAndIcon:Pt('#include "_prelude_lighting.glsl"\n#define SDF_PX 8.0\n#define SDF 1.0\n#define ICON 0.0\nuniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_halo;in float v_draw_halo;in vec4 v_data0;in vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\n#pragma mapbox: define lowp float emissive_strength\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\n#pragma mapbox: initialize lowp float emissive_strength\nfloat fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;glFragColor=texture(u_texture_icon,tex_icon)*alpha;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nreturn;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_data1.x;float size=v_data1.y;float fontScale=size/24.0;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;bool draw_halo=v_draw_halo > 0.0;if (draw_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).r;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);vec4 out_color=color*(alpha*opacity*fade_opacity);\n#ifdef LIGHTING_3D_MODE\nout_color=apply_lighting_with_emission_ground(out_color,emissive_strength);\n#endif\nglFragColor=out_color;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_terrain.vertex.glsl"\nin vec4 a_pos_offset;in vec4 a_tex_size;in vec4 a_projected_pos;in float a_fade_opacity;\n#ifdef OCCLUSION_QUERIES\nin float a_occlusion_query_opacity;\n#endif\n#ifdef Z_OFFSET\nin float a_z_offset;\n#endif\n#ifdef PROJECTION_GLOBE_VIEW\nin vec3 a_globe_anchor;in vec3 a_globe_normal;\n#endif\nuniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec3 u_up_vector;uniform vec2 u_texsize_icon;uniform bool u_is_halo;\n#ifdef PROJECTION_GLOBE_VIEW\nuniform vec3 u_tile_id;uniform mat4 u_inv_rot_matrix;uniform vec2 u_merc_center;uniform vec3 u_camera_forward;uniform float u_zoom_transition;uniform vec3 u_ecef_origin;uniform mat4 u_tile_matrix;\n#endif\nout float v_draw_halo;out vec4 v_data0;out vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\n#pragma mapbox: define lowp float emissive_strength\n#pragma mapbox: define lowp float occlusion_opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\n#pragma mapbox: initialize lowp float emissive_strength\n#pragma mapbox: initialize lowp float occlusion_opacity\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_tex_size.xy;vec2 a_size=a_tex_size.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;highp float segment_angle=-a_projected_pos[3];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 tile_anchor=a_pos;float e=elevation(tile_anchor);\n#ifdef Z_OFFSET\ne+=a_z_offset;\n#endif\nvec3 h=elevationVector(tile_anchor)*e;float globe_occlusion_fade;vec3 world_pos;vec3 mercator_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nmercator_pos=mercator_tile_position(u_inv_rot_matrix,tile_anchor,u_tile_id,u_merc_center);world_pos=mix_globe_mercator(a_globe_anchor+h,mercator_pos,u_zoom_transition);vec4 ecef_point=u_tile_matrix*vec4(world_pos,1.0);vec3 origin_to_point=ecef_point.xyz-u_ecef_origin;globe_occlusion_fade=dot(origin_to_point,u_camera_forward) >=0.0 ? 0.0 : 1.0;\n#else\nworld_pos=vec3(tile_anchor,0)+h;globe_occlusion_fade=1.0;\n#endif\nvec4 projected_point=u_matrix*vec4(world_pos,1);highp float camera_to_anchor_distance=projected_point.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(\n0.5+0.5*distance_ratio,0.0,1.5);size*=perspective_ratio;float font_scale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offset_projected_point=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projected_point.xy/projected_point.w;vec2 b=offset_projected_point.xy/offset_projected_point.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}vec4 projected_pos;\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 proj_pos=mix_globe_mercator(a_projected_pos.xyz+h,mercator_pos,u_zoom_transition);projected_pos=u_label_plane_matrix*vec4(proj_pos,1.0);\n#else\nprojected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,h.z,1.0);\n#endif\nhighp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);float z=0.0;vec2 offset=rotation_matrix*(a_offset/32.0*font_scale);\n#ifdef TERRAIN\n#ifdef PITCH_WITH_MAP_TERRAIN\nvec4 tile_pos=u_label_plane_matrix_inv*vec4(a_projected_pos.xy+offset,0.0,1.0);z=elevation(tile_pos.xy);\n#endif\n#endif\nfloat occlusion_fade=globe_occlusion_fade;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(occlusion_fade,fade_opacity[0]+fade_change));float projection_transition_fade=1.0;\n#if defined(PROJECTED_POS_ON_VIEWPORT) && defined(PROJECTION_GLOBE_VIEW)\nprojection_transition_fade=1.0-step(EPSILON,u_zoom_transition);\n#endif\nfloat out_fade_opacity=interpolated_fade_opacity*projection_transition_fade;\n#ifdef DEPTH_OCCLUSION\nfloat depthOcclusion=occlusionFadeMultiSample(projected_point);float depthOcclusionMultplier=mix(occlusion_opacity,1.0,depthOcclusion);out_fade_opacity*=depthOcclusionMultplier;\n#endif\n#ifdef OCCLUSION_QUERIES\nfloat occludedFadeMultiplier=mix(occlusion_opacity,1.0,a_occlusion_query_opacity);out_fade_opacity*=occludedFadeMultiplier;\n#endif\nfloat alpha=opacity*out_fade_opacity;float hidden=float(alpha==0.0 || projected_point.w <=0.0 || occlusion_fade==0.0);\n#ifdef PROJECTION_GLOBE_VIEW\nvec3 xAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,u_up_vector)) : vec3(1,0,0);vec3 yAxis=u_pitch_with_map ? normalize(cross(a_globe_normal,xAxis)) : vec3(0,1,0);gl_Position=mix(u_coord_matrix*vec4(projected_pos.xyz/projected_pos.w+ xAxis*offset.x+yAxis*offset.y,1.0),AWAY,hidden);\n#else\ngl_Position=mix(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+offset,z,1.0),AWAY,hidden);\n#endif\nfloat gamma_scale=gl_Position.w;v_draw_halo=(u_is_halo && float(gl_InstanceID)==0.0) ? 1.0 : 0.0;v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,out_fade_opacity,is_sdf);}'),terrainRaster:Pt('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_shadow.fragment.glsl"\n#include "_prelude_lighting.glsl"\nuniform sampler2D u_image0;in vec2 v_pos0;\n#ifdef FOG\nin float v_fog_opacity;\n#endif\n#ifdef RENDER_SHADOWS\nin vec4 v_pos_light_view_0;in vec4 v_pos_light_view_1;\n#endif\nuniform vec3 u_ground_shadow_factor;void main() {vec4 image_color=texture(u_image0,v_pos0);vec4 color;\n#ifdef LIGHTING_3D_MODE\nconst vec3 normal=vec3(0.0,0.0,1.0);\n#ifdef RENDER_SHADOWS\nfloat cutoffOpacity=1.0;\n#ifdef RENDER_CUTOFF\ncutoffOpacity=cutoff_opacity(u_cutoff_params,1.0/gl_FragCoord.w);\n#endif\n#ifdef LIGHTING_3D_ALPHA_EMISSIVENESS\nvec3 unlit_base=image_color.rgb*(1.0-image_color.a);vec3 emissive_base=image_color.rgb*image_color.a;float ndotl=u_shadow_direction.z;float occlusion=ndotl < 0.0 ? 1.0 : shadow_occlusion(v_pos_light_view_0,v_pos_light_view_1,1.0/gl_FragCoord.w,0.0);ndotl=max(0.0,ndotl);vec3 lit=apply_lighting(unlit_base,normal,mix(1.0,(1.0-(u_shadow_intensity*occlusion))*ndotl,cutoffOpacity));vec3 emissive=compute_emissive_draped(emissive_base,1.0-u_shadow_intensity,occlusion,u_ground_shadow_factor);color.rgb=lit+emissive;color.a=1.0;\n#else\nfloat lighting_factor=shadowed_light_factor_normal_unbiased(normal,v_pos_light_view_0,v_pos_light_view_1,1.0/gl_FragCoord.w);color=apply_lighting(image_color,normal,mix(1.0,lighting_factor,cutoffOpacity));\n#endif\n#else\nfloat lighting_factor=u_lighting_directional_dir.z;color=apply_lighting(image_color,normal,lighting_factor);\n#ifdef LIGHTING_3D_ALPHA_EMISSIVENESS\ncolor.rgb=mix(color.rgb,image_color.rgb,image_color.a);color.a=1.0;\n#endif\n#endif\n#else\ncolor=image_color;\n#endif\n#ifdef FOG\n#ifdef ZERO_EXAGGERATION\ncolor=fog_dither(fog_apply_premultiplied(color,v_fog_pos));\n#else\ncolor=fog_dither(fog_apply_from_vert(color,v_fog_opacity));\n#endif\n#endif\nglFragColor=color;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_terrain.vertex.glsl"\nuniform mat4 u_matrix;uniform float u_skirt_height;in vec2 a_pos;out vec2 v_pos0;\n#ifdef FOG\nout float v_fog_opacity;\n#endif\n#ifdef RENDER_SHADOWS\nuniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out vec4 v_pos_light_view_0;out vec4 v_pos_light_view_1;out float v_depth;\n#endif\nvoid main() {vec3 decomposedPosAndSkirt=decomposeToPosAndSkirt(a_pos);float skirt=decomposedPosAndSkirt.z;vec2 decodedPos=decomposedPosAndSkirt.xy;float elevation=elevation(decodedPos)-skirt*u_skirt_height;v_pos0=decodedPos/8192.0;gl_Position=u_matrix*vec4(decodedPos,elevation,1.0);\n#ifdef FOG\n#ifdef ZERO_EXAGGERATION\nv_fog_pos=fog_position(decodedPos);\n#else\nv_fog_opacity=fog(fog_position(vec3(decodedPos,elevation)));\n#endif\n#endif\n#ifdef RENDER_SHADOWS\nvec3 pos=vec3(decodedPos,elevation);v_pos_light_view_0=u_light_matrix_0*vec4(pos,1.);v_pos_light_view_1=u_light_matrix_1*vec4(pos,1.);\n#endif\n}'),terrainDepth:Pt("precision highp float;in float v_depth;void main() {glFragColor=pack_depth(v_depth);}",'#include "_prelude_terrain.vertex.glsl"\nuniform mat4 u_matrix;in vec2 a_pos;out float v_depth;void main() {float elevation=elevation(a_pos);gl_Position=u_matrix*vec4(a_pos,elevation,1.0);v_depth=gl_Position.z/gl_Position.w;}'),skybox:Pt('#include "_prelude_fog.fragment.glsl"\nin lowp vec3 v_uv;uniform lowp samplerCube u_cubemap;uniform lowp float u_opacity;uniform highp float u_temporal_offset;uniform highp vec3 u_sun_direction;float sun_disk(highp vec3 ray_direction,highp vec3 sun_direction) {highp float cos_angle=dot(normalize(ray_direction),sun_direction);const highp float cos_sun_angular_diameter=0.99996192306;const highp float smoothstep_delta=1e-5;return smoothstep(\ncos_sun_angular_diameter-smoothstep_delta,cos_sun_angular_diameter+smoothstep_delta,cos_angle);}float map(float value,float start,float end,float new_start,float new_end) {return ((value-start)*(new_end-new_start))/(end-start)+new_start;}void main() {vec3 uv=v_uv;const float y_bias=0.015;uv.y+=y_bias;uv.y=pow(abs(uv.y),1.0/5.0);uv.y=map(uv.y,0.0,1.0,-1.0,1.0);vec3 sky_color=texture(u_cubemap,uv).rgb;\n#ifdef FOG\nsky_color=fog_apply_sky_gradient(v_uv.xzy,sky_color);\n#endif\nsky_color.rgb=dither(sky_color.rgb,gl_FragCoord.xy+u_temporal_offset);sky_color+=0.1*sun_disk(v_uv,u_sun_direction);glFragColor=vec4(sky_color*u_opacity,u_opacity);\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\n}',mt),skyboxGradient:Pt('#include "_prelude_fog.fragment.glsl"\nin highp vec3 v_uv;uniform lowp sampler2D u_color_ramp;uniform highp vec3 u_center_direction;uniform lowp float u_radius;uniform lowp float u_opacity;uniform highp float u_temporal_offset;void main() {float progress=acos(dot(normalize(v_uv),u_center_direction))/u_radius;vec4 color=texture(u_color_ramp,vec2(progress,0.5));\n#ifdef FOG\ncolor.rgb=fog_apply_sky_gradient(v_uv.xzy,color.rgb/color.a)*color.a;\n#endif\ncolor*=u_opacity;color.rgb=dither(color.rgb,gl_FragCoord.xy+u_temporal_offset);glFragColor=color;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\n}',mt),skyboxCapture:Pt("\nin highp vec3 v_position;uniform highp float u_sun_intensity;uniform highp float u_luminance;uniform lowp vec3 u_sun_direction;uniform highp vec4 u_color_tint_r;uniform highp vec4 u_color_tint_m;precision highp float;\n#define BETA_R vec3(5.5e-6,13.0e-6,22.4e-6)\n#define BETA_M vec3(21e-6,21e-6,21e-6)\n#define MIE_G 0.76\n#define DENSITY_HEIGHT_SCALE_R 8000.0\n#define DENSITY_HEIGHT_SCALE_M 1200.0\n#define PLANET_RADIUS 6360e3\n#define ATMOSPHERE_RADIUS 6420e3\n#define SAMPLE_STEPS 10\n#define DENSITY_STEPS 4\nfloat ray_sphere_exit(vec3 orig,vec3 dir,float radius) {float a=dot(dir,dir);float b=2.0*dot(dir,orig);float c=dot(orig,orig)-radius*radius;float d=sqrt(b*b-4.0*a*c);return (-b+d)/(2.0*a);}vec3 extinction(vec2 density) {return exp(-vec3(BETA_R*u_color_tint_r.a*density.x+BETA_M*u_color_tint_m.a*density.y));}vec2 local_density(vec3 point) {float height=max(length(point)-PLANET_RADIUS,0.0);float exp_r=exp(-height/DENSITY_HEIGHT_SCALE_R);float exp_m=exp(-height/DENSITY_HEIGHT_SCALE_M);return vec2(exp_r,exp_m);}float phase_ray(float cos_angle) {return (3.0/(16.0*PI))*(1.0+cos_angle*cos_angle);}float phase_mie(float cos_angle) {return (3.0/(8.0*PI))*((1.0-MIE_G*MIE_G)*(1.0+cos_angle*cos_angle))/((2.0+MIE_G*MIE_G)*pow(1.0+MIE_G*MIE_G-2.0*MIE_G*cos_angle,1.5));}vec2 density_to_atmosphere(vec3 point,vec3 light_dir) {float ray_len=ray_sphere_exit(point,light_dir,ATMOSPHERE_RADIUS);float step_len=ray_len/float(DENSITY_STEPS);vec2 density_point_to_atmosphere=vec2(0.0);for (int i=0; i < DENSITY_STEPS;++i) {vec3 point_on_ray=point+light_dir*((float(i)+0.5)*step_len);density_point_to_atmosphere+=local_density(point_on_ray)*step_len;;}return density_point_to_atmosphere;}vec3 atmosphere(vec3 ray_dir,vec3 sun_direction,float sun_intensity) {vec2 density_orig_to_point=vec2(0.0);vec3 scatter_r=vec3(0.0);vec3 scatter_m=vec3(0.0);vec3 origin=vec3(0.0,PLANET_RADIUS,0.0);float ray_len=ray_sphere_exit(origin,ray_dir,ATMOSPHERE_RADIUS);float step_len=ray_len/float(SAMPLE_STEPS);for (int i=0; i < SAMPLE_STEPS;++i) {vec3 point_on_ray=origin+ray_dir*((float(i)+0.5)*step_len);vec2 density=local_density(point_on_ray)*step_len;density_orig_to_point+=density;vec2 density_point_to_atmosphere=density_to_atmosphere(point_on_ray,sun_direction);vec2 density_orig_to_atmosphere=density_orig_to_point+density_point_to_atmosphere;vec3 extinction=extinction(density_orig_to_atmosphere);scatter_r+=density.x*extinction;scatter_m+=density.y*extinction;}float cos_angle=dot(ray_dir,sun_direction);float phase_r=phase_ray(cos_angle);float phase_m=phase_mie(cos_angle);vec3 beta_r=BETA_R*u_color_tint_r.rgb*u_color_tint_r.a;vec3 beta_m=BETA_M*u_color_tint_m.rgb*u_color_tint_m.a;return (scatter_r*phase_r*beta_r+scatter_m*phase_m*beta_m)*sun_intensity;}const float A=0.15;const float B=0.50;const float C=0.10;const float D=0.20;const float E=0.02;const float F=0.30;vec3 uncharted2_tonemap(vec3 x) {return ((x*(A*x+C*B)+D*E)/(x*(A*x+B)+D*F))-E/F;}void main() {vec3 ray_direction=v_position;ray_direction.y=pow(ray_direction.y,5.0);const float y_bias=0.015;ray_direction.y+=y_bias;vec3 color=atmosphere(normalize(ray_direction),u_sun_direction,u_sun_intensity);float white_scale=1.0748724675633854;color=uncharted2_tonemap((log2(2.0/pow(u_luminance,4.0)))*color)*white_scale;glFragColor=vec4(color,1.0);}","in highp vec3 a_pos_3f;uniform mat3 u_matrix_3f;out highp vec3 v_position;float map(float value,float start,float end,float new_start,float new_end) {return ((value-start)*(new_end-new_start))/(end-start)+new_start;}void main() {vec4 pos=vec4(u_matrix_3f*a_pos_3f,1.0);v_position=pos.xyz;v_position.y*=-1.0;v_position.y=map(v_position.y,-1.0,1.0,0.0,1.0);gl_Position=vec4(a_pos_3f.xy,0.0,1.0);}"),globeRaster:Pt('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_lighting.glsl"\nuniform sampler2D u_image0;uniform float u_far_z_cutoff;in vec2 v_pos0;\n#ifndef FOG\nuniform highp vec3 u_frustum_tl;uniform highp vec3 u_frustum_tr;uniform highp vec3 u_frustum_br;uniform highp vec3 u_frustum_bl;uniform highp vec3 u_globe_pos;uniform highp float u_globe_radius;uniform vec2 u_viewport;\n#endif\nvoid main() {vec4 color;\n#ifdef CUSTOM_ANTIALIASING\nvec2 uv=gl_FragCoord.xy/u_viewport;highp vec3 ray_dir=mix(\nmix(u_frustum_tl,u_frustum_tr,uv.x),mix(u_frustum_bl,u_frustum_br,uv.x),1.0-uv.y);vec3 dir=normalize(ray_dir);vec3 closest_point=dot(u_globe_pos,dir)*dir;float norm_dist_from_center=1.0-length(closest_point-u_globe_pos)/u_globe_radius;const float antialias_pixel=2.0;float antialias_factor=antialias_pixel*fwidth(norm_dist_from_center);float antialias=smoothstep(0.0,antialias_factor,norm_dist_from_center);vec4 raster=texture(u_image0,v_pos0);\n#ifdef LIGHTING_3D_MODE\n#ifdef LIGHTING_3D_ALPHA_EMISSIVENESS\nraster=apply_lighting_with_emission_ground(raster,raster.a);color=vec4(raster.rgb*antialias,antialias);\n#else\nraster=apply_lighting_ground(raster);color=vec4(raster.rgb*antialias,raster.a*antialias);\n#endif\n#else\ncolor=vec4(raster.rgb*antialias,raster.a*antialias);\n#endif\n#else\ncolor=texture(u_image0,v_pos0);\n#ifdef LIGHTING_3D_MODE\n#ifdef LIGHTING_3D_ALPHA_EMISSIVENESS\ncolor=apply_lighting_with_emission_ground(color,color.a);color.a=1.0;\n#else\ncolor=apply_lighting_ground(color);\n#endif\n#endif\n#endif\n#ifdef FOG\ncolor=fog_dither(fog_apply_premultiplied(color,v_fog_pos));\n#endif\ncolor*=1.0-step(u_far_z_cutoff,1.0/gl_FragCoord.w);glFragColor=color;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_terrain.vertex.glsl"\nuniform mat4 u_proj_matrix;uniform mat4 u_normalize_matrix;uniform mat4 u_globe_matrix;uniform mat4 u_merc_matrix;uniform float u_zoom_transition;uniform vec2 u_merc_center;uniform mat3 u_grid_matrix;uniform float u_skirt_height;\n#ifdef GLOBE_POLES\nin vec3 a_globe_pos;in vec2 a_uv;\n#else\nin vec2 a_pos;\n#endif\nout vec2 v_pos0;void main() {\n#ifdef GLOBE_POLES\nvec3 globe_pos=a_globe_pos;vec2 uv=a_uv;\n#else\nfloat tiles=u_grid_matrix[0][2];float idx=u_grid_matrix[1][2];float idy=u_grid_matrix[2][2];vec3 decomposed_pos_and_skirt=decomposeToPosAndSkirt(a_pos);vec3 latLng=u_grid_matrix*vec3(decomposed_pos_and_skirt.xy,1.0);float mercatorY=mercatorYfromLat(latLng[0]);float uvY=mercatorY*tiles-idy;float mercatorX=mercatorXfromLng(latLng[1]);float uvX=mercatorX*tiles-idx;vec3 globe_pos=latLngToECEF(latLng.xy);vec2 merc_pos=vec2(mercatorX,mercatorY);vec2 uv=vec2(uvX,uvY);\n#endif\nv_pos0=uv;vec2 tile_pos=uv*EXTENT;vec3 globe_derived_up_vector=normalize(globe_pos)*u_tile_up_scale;\n#ifdef GLOBE_POLES\nvec3 up_vector=globe_derived_up_vector;\n#else\nvec3 up_vector=elevationVector(tile_pos);\n#endif\nfloat height=elevation(tile_pos);globe_pos+=up_vector*height;\n#ifndef GLOBE_POLES\nglobe_pos-=globe_derived_up_vector*u_skirt_height*decomposed_pos_and_skirt.z;\n#endif\n#ifdef GLOBE_POLES\nvec4 interpolated_pos=u_globe_matrix*vec4(globe_pos,1.0);\n#else\nvec4 globe_world_pos=u_globe_matrix*vec4(globe_pos,1.0);vec4 merc_world_pos=vec4(0.0);if (u_zoom_transition > 0.0) {merc_world_pos=vec4(merc_pos,height-u_skirt_height*decomposed_pos_and_skirt.z,1.0);merc_world_pos.xy-=u_merc_center;merc_world_pos.x=wrap(merc_world_pos.x,-0.5,0.5);merc_world_pos=u_merc_matrix*merc_world_pos;}vec4 interpolated_pos=vec4(mix(globe_world_pos.xyz,merc_world_pos.xyz,u_zoom_transition),1.0);\n#endif\ngl_Position=u_proj_matrix*interpolated_pos;\n#ifdef FOG\nv_fog_pos=fog_position((u_normalize_matrix*vec4(globe_pos,1.0)).xyz);\n#endif\n}'),globeAtmosphere:Pt('#include "_prelude_fog.fragment.glsl"\nuniform float u_transition;uniform highp float u_fadeout_range;uniform highp float u_temporal_offset;uniform vec4 u_color;uniform vec4 u_high_color;uniform vec4 u_space_color;uniform float u_horizon_angle;in highp vec3 v_ray_dir;in highp vec3 v_horizon_dir;void main() {highp vec3 dir=normalize(v_ray_dir);float globe_pos_dot_dir;\n#ifdef PROJECTION_GLOBE_VIEW\nglobe_pos_dot_dir=dot(u_globe_pos,dir);highp vec3 closest_point_forward=abs(globe_pos_dot_dir)*dir;float norm_dist_from_center=length(closest_point_forward-u_globe_pos)/u_globe_radius;if (norm_dist_from_center < 0.98) {\n#ifdef ALPHA_PASS\nglFragColor=vec4(0,0,0,0);return;\n#else\n#ifdef NATIVE\nglFragColor=vec4(1,1,1,1);\n#else\nglFragColor=vec4(0,0,0,1);\n#endif\nreturn;\n#endif\n}\n#endif\nhighp vec3 horizon_dir=normalize(v_horizon_dir);float horizon_angle_mercator=dir.y < horizon_dir.y ?\n0.0 : max(acos(clamp(dot(dir,horizon_dir),-1.0,1.0)),0.0);float horizon_angle;\n#ifdef PROJECTION_GLOBE_VIEW\nhighp vec3 closest_point=globe_pos_dot_dir*dir;highp float closest_point_to_center=length(closest_point-u_globe_pos);highp float theta=asin(clamp(closest_point_to_center/length(u_globe_pos),-1.0,1.0));horizon_angle=globe_pos_dot_dir < 0.0 ?\nPI-theta-u_horizon_angle : theta-u_horizon_angle;float angle_t=pow(u_transition,10.0);horizon_angle=mix(horizon_angle,horizon_angle_mercator,angle_t);\n#else\nhorizon_angle=horizon_angle_mercator;\n#endif\nhorizon_angle/=PI;float t=exp(-horizon_angle/u_fadeout_range);float alpha_0=u_color.a;float alpha_1=u_high_color.a;float alpha_2=u_space_color.a;vec3 color_stop_0=u_color.rgb;vec3 color_stop_1=u_high_color.rgb;vec3 color_stop_2=u_space_color.rgb;\n#ifdef ALPHA_PASS\nfloat a0=mix(alpha_2,1.0,alpha_1);float a1=mix(a0,1.0,alpha_0);float a2=mix(a0,a1,t);float a =mix(alpha_2,a2,t);glFragColor=vec4(1.0,1.0,1.0,a);\n#else\nvec3 c0=mix(color_stop_2,color_stop_1,alpha_1);vec3 c1=mix(c0,color_stop_0,alpha_0);vec3 c2=mix(c0,c1,t);vec3 c=c2;\n#ifndef NATIVE\nc=dither(c,gl_FragCoord.xy+u_temporal_offset);\n#endif\nglFragColor=vec4(c*t,t);\n#endif\n}',"in vec3 a_pos;in vec2 a_uv;uniform vec3 u_frustum_tl;uniform vec3 u_frustum_tr;uniform vec3 u_frustum_br;uniform vec3 u_frustum_bl;uniform float u_horizon;out highp vec3 v_ray_dir;out highp vec3 v_horizon_dir;void main() {v_ray_dir=mix(\nmix(u_frustum_tl,u_frustum_tr,a_uv.x),mix(u_frustum_bl,u_frustum_br,a_uv.x),a_uv.y);v_horizon_dir=mix(\nmix(u_frustum_tl,u_frustum_bl,u_horizon),mix(u_frustum_tr,u_frustum_br,u_horizon),a_uv.x);gl_Position=vec4(a_pos,1.0);}"),model:Pt('#include "_prelude_fog.fragment.glsl"\n#include "_prelude_shadow.fragment.glsl"\n#include "_prelude_lighting.glsl"\nuniform float u_opacity;uniform vec3 u_lightcolor;uniform vec3 u_lightpos;uniform float u_lightintensity;uniform vec4 u_baseColorFactor;uniform vec4 u_emissiveFactor;uniform float u_metallicFactor;uniform float u_roughnessFactor;uniform float u_emissive_strength;in highp vec4 v_position_height;in lowp vec4 v_color_mix;\n#ifdef RENDER_SHADOWS\nin highp vec4 v_pos_light_view_0;in highp vec4 v_pos_light_view_1;in float v_depth_shadows;\n#endif\n#ifdef OCCLUSION_TEXTURE_TRANSFORM\nuniform vec4 u_occlusionTextureTransform;\n#endif\n#pragma mapbox: define-attribute highp vec3 normal_3f\n#pragma mapbox: define-attribute highp vec3 color_3f\n#pragma mapbox: define-attribute highp vec4 color_4f\n#pragma mapbox: define-attribute highp vec2 uv_2f\n#pragma mapbox: initialize-attribute highp vec3 normal_3f\n#pragma mapbox: initialize-attribute highp vec3 color_3f\n#pragma mapbox: initialize-attribute highp vec4 color_4f\n#pragma mapbox: initialize-attribute highp vec2 uv_2f\n#ifdef HAS_ATTRIBUTE_a_pbr\nin lowp vec4 v_roughness_metallic_emissive_alpha;in mediump vec4 v_height_based_emission_params;\n#endif\n#ifdef HAS_TEXTURE_u_baseColorTexture\nuniform sampler2D u_baseColorTexture;uniform bool u_baseTextureIsAlpha;uniform bool u_alphaMask;uniform float u_alphaCutoff;\n#endif\n#ifdef HAS_TEXTURE_u_metallicRoughnessTexture\nuniform sampler2D u_metallicRoughnessTexture;\n#endif\n#ifdef HAS_TEXTURE_u_occlusionTexture\nuniform sampler2D u_occlusionTexture;uniform float u_aoIntensity;\n#endif\n#ifdef HAS_TEXTURE_u_normalTexture\nuniform sampler2D u_normalTexture;\n#endif\n#ifdef HAS_TEXTURE_u_emissionTexture\nuniform sampler2D u_emissionTexture;\n#endif\n#ifdef APPLY_LUT_ON_GPU\nuniform highp sampler3D u_lutTexture;\n#endif\n#ifdef TERRAIN_FRAGMENT_OCCLUSION\nin highp float v_depth;uniform highp sampler2D u_depthTexture;uniform vec2 u_inv_depth_size;uniform vec2 u_depth_range_unpack;\n#ifdef DEPTH_D24\nfloat unpack_depth(float depth) {return depth*u_depth_range_unpack.x+u_depth_range_unpack.y;}\n#else\nhighp float unpack_depth_rgba(highp vec4 rgba_depth)\n{const highp vec4 bit_shift=vec4(1.0/(255.0*255.0*255.0),1.0/(255.0*255.0),1.0/255.0,1.0);return dot(rgba_depth,bit_shift)*2.0-1.0;}\n#endif\nbool isOccluded() {vec2 coord=gl_FragCoord.xy*u_inv_depth_size;\n#ifdef DEPTH_D24\nhighp float depth=unpack_depth(texture(u_depthTexture,coord).r);\n#else\nhighp float depth=unpack_depth_rgba(texture(u_depthTexture,coord));\n#endif\nreturn v_depth > depth+0.0005;}\n#endif\n#define saturate(_x) clamp(_x,0.,1.)\nvec3 linearTosRGB(vec3 color) {return pow(color,vec3(1./2.2));}vec3 sRGBToLinear(vec3 srgbIn) {return pow(srgbIn,vec3(2.2));}float calculate_NdotL(vec3 normal,vec3 lightDir) {const float ext=0.70710678118;return (clamp(dot(normal,lightDir),-ext,1.0)+ext)/(1.0+ext);}vec3 getDiffuseShadedColor(vec3 albedo,vec3 normal,vec3 lightDir,vec3 lightColor)\n{\n#ifdef LIGHTING_3D_MODE\nvec3 transformed_normal=vec3(-normal.xy,normal.z);float lighting_factor;\n#ifdef RENDER_SHADOWS\nlighting_factor=shadowed_light_factor_normal(transformed_normal,v_pos_light_view_0,v_pos_light_view_1,v_depth_shadows);\n#else\nlighting_factor=saturate(dot(transformed_normal,u_lighting_directional_dir));\n#endif\nreturn apply_lighting(albedo,transformed_normal,lighting_factor);\n#else\nvec3 n=normal;float colorvalue=((albedo.x*0.2126)+(albedo.y*0.7152))+(albedo.z*0.0722);vec3 c=vec3(0.03,0.03,0.03);float directional=clamp(dot(n,vec3(lightDir)),0.0,1.0);directional=mix(1.0-u_lightintensity,max((1.0-colorvalue)+u_lightintensity,1.0),directional);vec3 c3=c+clamp((albedo*directional)*lightColor,mix(vec3(0.0),vec3(0.3),vec3(1.0)-lightColor),vec3(1.0));return c3;\n#endif\n}vec4 getBaseColor() {vec4 albedo=u_baseColorFactor;\n#ifdef HAS_ATTRIBUTE_a_color_3f\nalbedo*=vec4(color_3f,1.0);\n#endif\n#ifdef HAS_ATTRIBUTE_a_pbr\n#else\n#ifdef HAS_ATTRIBUTE_a_color_4f\nalbedo*=color_4f;\n#endif\n#endif\n#if defined (HAS_TEXTURE_u_baseColorTexture) && defined (HAS_ATTRIBUTE_a_uv_2f)\nvec4 texColor=texture(u_baseColorTexture,uv_2f);if(u_alphaMask) {if (texColor.w < u_alphaCutoff) {discard;}}\n#ifdef UNPREMULT_TEXTURE_IN_SHADER\nif(texColor.w > 0.0) {texColor.rgb/=texColor.w;}texColor.w=1.0;\n#endif\nif(u_baseTextureIsAlpha) {if (texColor.r < 0.5) {discard;}} else {texColor.rgb=sRGBToLinear(texColor.rgb);albedo*=texColor;}\n#endif\nvec4 color=vec4(mix(albedo.rgb,v_color_mix.rgb,v_color_mix.a),albedo.a);\n#ifdef APPLY_LUT_ON_GPU\ncolor=applyLUT(u_lutTexture,color);\n#endif\nreturn color;}highp mat3 cotangentFrame(highp vec3 N,highp vec3 p,highp vec2 uv ) {\n#ifdef HAS_TEXTURE_u_normalTexture\nhighp vec3 dp1=vec3(dFdx(p.x),dFdx(p.y),dFdx(p.z));highp vec3 dp2=vec3(dFdy(p.x),dFdy(p.y),dFdy(p.z));highp vec2 duv1=vec2(dFdx(uv.x),dFdx(uv.y));highp vec2 duv2=vec2(dFdy(uv.x),dFdy(uv.y));highp vec3 dp2perp=cross( dp2,N );highp vec3 dp1perp=cross( N,dp1 );highp vec3 T=dp2perp*duv1.x+dp1perp*duv2.x;highp vec3 B=dp2perp*duv1.y+dp1perp*duv2.y;highp float lengthT=dot(T,T);highp float lengthB=dot(B,B);highp float maxLength=max(lengthT,lengthB);highp float invmax=inversesqrt( maxLength );highp mat3 res=mat3( T*invmax,B*invmax,N );return res;\n#else\nreturn mat3(1.0);\n#endif\n}highp vec3 getNormal(){highp vec3 n;\n#ifdef HAS_ATTRIBUTE_a_normal_3f\nn=normalize(normal_3f);\n#else\nhighp vec3 fdx=vec3(dFdx(v_position_height.x),dFdx(v_position_height.y),dFdx(v_position_height.z));highp vec3 fdy=vec3(dFdy(v_position_height.x),dFdy(v_position_height.y),dFdy(v_position_height.z));n=normalize(cross(fdx,fdy))*-1.0;\n#endif\n#if defined(HAS_TEXTURE_u_normalTexture) && defined(HAS_ATTRIBUTE_a_uv_2f)\nvec3 nMap=texture( u_normalTexture,uv_2f).xyz;nMap=normalize(2.0*nMap-vec3(1.0));highp vec3 v=normalize(-v_position_height.xyz);highp mat3 TBN=cotangentFrame(n,v,uv_2f);n=normalize(TBN*nMap);\n#endif\nreturn n;}struct Material {float perceptualRoughness;float alphaRoughness;float metallic;vec3 f90;vec4 baseColor;vec3 diffuseColor;vec3 specularColor;highp vec3 normal;};Material getPBRMaterial() {Material mat;mat.baseColor=getBaseColor();mat.perceptualRoughness=u_roughnessFactor;mat.metallic=u_metallicFactor;\n#ifdef HAS_ATTRIBUTE_a_pbr\nmat.perceptualRoughness=v_roughness_metallic_emissive_alpha.x;mat.metallic=v_roughness_metallic_emissive_alpha.y;mat.baseColor.w*=v_roughness_metallic_emissive_alpha.w;\n#endif\n#if defined(HAS_TEXTURE_u_metallicRoughnessTexture) && defined(HAS_ATTRIBUTE_a_uv_2f) \nvec4 mrSample=texture(u_metallicRoughnessTexture,uv_2f);mat.perceptualRoughness*=mrSample.g;mat.metallic*=mrSample.b;\n#endif\nconst float c_minRoughness=0.04;mat.perceptualRoughness=clamp(mat.perceptualRoughness,c_minRoughness,1.0);mat.metallic=saturate(mat.metallic);mat.alphaRoughness=mat.perceptualRoughness*mat.perceptualRoughness;const vec3 f0=vec3(0.04);mat.diffuseColor=mat.baseColor.rgb*(vec3(1.0)-f0);mat.diffuseColor*=1.0-mat.metallic;mat.specularColor=mix(f0,mat.baseColor.rgb,mat.metallic);highp float reflectance=max(max(mat.specularColor.r,mat.specularColor.g),mat.specularColor.b);highp float reflectance90=saturate(reflectance*25.0);mat.f90=vec3(reflectance90);mat.normal=getNormal();return mat;}float V_GGX(float NdotL,float NdotV,float roughness)\n{float a2=roughness*roughness;float GGXV=NdotL*sqrt(NdotV*NdotV*(1.0-a2)+a2);float GGXL=NdotV*sqrt(NdotL*NdotL*(1.0-a2)+a2);return 0.5/(GGXV+GGXL);}float V_GGXFast(float NdotL,float NdotV,float roughness) {float a=roughness;float GGXV=NdotL*(NdotV*(1.0-a)+a);float GGXL=NdotV*(NdotL*(1.0-a)+a);return 0.5/(GGXV+GGXL);}vec3 F_Schlick(vec3 specularColor,vec3 f90,float VdotH)\n{return specularColor+(f90-specularColor)*pow(clamp(1.0-VdotH,0.0,1.0),5.0);}vec3 F_SchlickFast(vec3 specularColor,float VdotH)\n{float x=1.0-VdotH;float x4=x*x*x*x;return specularColor+(1.0-specularColor)*x4*x;}float D_GGX(highp float NdotH,float alphaRoughness)\n{highp float a4=alphaRoughness*alphaRoughness;highp float f=(NdotH*a4-NdotH)*NdotH+1.0;return a4/(PI*f*f);}vec3 diffuseBurley(Material mat,float LdotH,float NdotL,float NdotV)\n{float f90=2.0*LdotH*LdotH*mat.alphaRoughness-0.5;return (mat.diffuseColor/PI)*(1.0+f90*pow((1.0-NdotL),5.0))*(1.0+f90*pow((1.0-NdotV),5.0));}vec3 diffuseLambertian(Material mat)\n{\n#ifdef LIGHTING_3D_MODE\nreturn mat.diffuseColor;\n#else\nreturn mat.diffuseColor/PI;\n#endif\n}vec3 EnvBRDFApprox(vec3 specularColor,float roughness,highp float NdotV)\n{vec4 c0=vec4(-1,-0.0275,-0.572,0.022);vec4 c1=vec4(1,0.0425,1.04,-0.04);highp vec4 r=roughness*c0+c1;highp float a004=min(r.x*r.x,exp2(-9.28*NdotV))*r.x+r.y;vec2 AB=vec2(-1.04,1.04)*a004+r.zw;return specularColor*AB.x+AB.y;}vec3 computeIndirectLightContribution(Material mat,float NdotV,vec3 normal)\n{vec3 env_light=vec3(0.65,0.65,0.65);\n#ifdef LIGHTING_3D_MODE\nfloat ambient_factor=calculate_ambient_directional_factor(normal);env_light=u_lighting_ambient_color*ambient_factor;\n#endif\nvec3 envBRDF=EnvBRDFApprox(mat.specularColor,mat.perceptualRoughness,NdotV);vec3 indirectSpecular= envBRDF*env_light;vec3 indirectDiffuse=mat.diffuseColor*env_light;return indirectSpecular+indirectDiffuse;}vec3 computeLightContribution(Material mat,vec3 lightPosition,vec3 lightColor)\n{highp vec3 n=mat.normal;highp vec3 v=normalize(-v_position_height.xyz);highp vec3 l=normalize(lightPosition);highp vec3 h=normalize(v+l);float NdotV=clamp(abs(dot(n,v)),0.001,1.0);float NdotL=saturate(dot(n,l));highp float NdotH=saturate(dot(n,h));float VdotH=saturate(dot(v,h));vec3 f=F_SchlickFast(mat.specularColor,VdotH);float g=V_GGXFast(NdotL,NdotV,mat.alphaRoughness);float d=D_GGX(NdotH,mat.alphaRoughness);vec3 diffuseTerm=(1.0-f)*diffuseLambertian(mat);vec3 specularTerm=f*g*d;vec3 transformed_normal=vec3(-n.xy,n.z);float lighting_factor;\n#ifdef RENDER_SHADOWS\nlighting_factor=shadowed_light_factor_normal(transformed_normal,v_pos_light_view_0,v_pos_light_view_1,v_depth_shadows);\n#else\nlighting_factor=NdotL;\n#endif\nvec3 directLightColor=(specularTerm+diffuseTerm)*lighting_factor*lightColor;vec3 indirectLightColor=computeIndirectLightContribution(mat,NdotV,transformed_normal);vec3 color=(saturate(directLightColor)+indirectLightColor);float intensityFactor=1.0;\n#if !defined(LIGHTING_3D_MODE)\nconst vec3 luminosityFactor=vec3(0.2126,0.7152,0.0722);float luminance=dot(diffuseTerm,luminosityFactor);intensityFactor=mix((1.0-u_lightintensity),max((1.0-luminance+u_lightintensity),1.0),NdotL);\n#endif\ncolor*=intensityFactor;return color;}void main() {\n#ifdef TERRAIN_FRAGMENT_OCCLUSION\nif (isOccluded()) {discard;}\n#endif\nvec3 lightDir=u_lightpos;vec3 lightColor=u_lightcolor;\n#ifdef LIGHTING_3D_MODE\nlightDir=u_lighting_directional_dir;lightDir.xy=-lightDir.xy;lightColor=u_lighting_directional_color;\n#endif\nvec4 finalColor;\n#ifdef DIFFUSE_SHADED\nvec3 N=getNormal();vec3 baseColor=getBaseColor().rgb;vec3 diffuse=getDiffuseShadedColor(baseColor,N,lightDir,lightColor);\n#ifdef HAS_TEXTURE_u_occlusionTexture\nfloat ao=(texture(u_occlusionTexture,uv_2f).r-1.0)*u_aoIntensity+1.0;diffuse*=ao;\n#endif\nfinalColor=vec4(mix(diffuse,baseColor,u_emissive_strength),1.0)*u_opacity;\n#else\nMaterial mat=getPBRMaterial();vec3 color=computeLightContribution(mat,lightDir,lightColor);float ao=1.0;\n#if defined (HAS_TEXTURE_u_occlusionTexture) && defined(HAS_ATTRIBUTE_a_uv_2f)\n#ifdef OCCLUSION_TEXTURE_TRANSFORM\nvec2 uv=uv_2f.xy*u_occlusionTextureTransform.zw+u_occlusionTextureTransform.xy;\n#else\nvec2 uv=uv_2f;\n#endif\nao=(texture(u_occlusionTexture,uv).x-1.0)*u_aoIntensity+1.0;color*=ao;\n#endif\nvec4 emissive=u_emissiveFactor;\n#if defined(HAS_TEXTURE_u_emissionTexture) && defined(HAS_ATTRIBUTE_a_uv_2f)\nemissive.rgb*=sRGBToLinear(texture(u_emissionTexture,uv_2f).rgb);\n#endif\n#ifdef APPLY_LUT_ON_GPU\nfloat emissiveFactorLength=max(length(u_emissiveFactor.rgb),0.001);emissive.rgb=sRGBToLinear(applyLUT(u_lutTexture,linearTosRGB(emissive.rgb/emissiveFactorLength).rbg))*emissiveFactorLength;\n#endif\ncolor+=emissive.rgb;float opacity=mat.baseColor.w*u_opacity;\n#ifdef HAS_ATTRIBUTE_a_pbr\nfloat resEmission=v_roughness_metallic_emissive_alpha.z;resEmission*=v_height_based_emission_params.z+v_height_based_emission_params.w*pow(clamp(v_height_based_emission_params.x,0.0,1.0),v_height_based_emission_params.y);vec3 color_mix=v_color_mix.rgb;\n#ifdef APPLY_LUT_ON_GPU\ncolor_mix=applyLUT(u_lutTexture,color_mix);\n#endif\ncolor=mix(color,color_mix,min(1.0,resEmission));\n#ifdef HAS_ATTRIBUTE_a_color_4f\nfloat distance=length(vec2(1.3*max(0.0,abs(color_4f.x)-color_4f.z),color_4f.y));distance+= mix(0.5,0.0,clamp(resEmission-1.0,0.0,1.0));opacity*=v_roughness_metallic_emissive_alpha.w*saturate(1.0-distance*distance);\n#endif\n#endif\nvec3 unlitColor=mat.baseColor.rgb*ao+emissive.rgb;color=mix(color,unlitColor,u_emissive_strength);color=linearTosRGB(color);color*=opacity;finalColor=vec4(color,opacity);\n#endif\n#ifdef FOG\nfinalColor=fog_dither(fog_apply_premultiplied(finalColor,v_fog_pos,v_position_height.w));\n#endif\n#ifdef RENDER_CUTOFF\nfinalColor*=v_cutoff_opacity;\n#endif\n#ifdef INDICATOR_CUTOUT\nfinalColor=applyCutout(finalColor);\n#endif\nglFragColor=finalColor;\n#ifdef OVERDRAW_INSPECTOR\nglFragColor=vec4(1.0);\n#endif\nHANDLE_WIREFRAME_DEBUG;}','#include "_prelude_fog.vertex.glsl"\n#include "_prelude_shadow.vertex.glsl"\nin vec3 a_pos_3f;\n#pragma mapbox: define-attribute highp vec3 normal_3f\n#pragma mapbox: define-attribute highp vec2 uv_2f\n#pragma mapbox: define-attribute highp vec3 color_3f\n#pragma mapbox: define-attribute highp vec4 color_4f\n#pragma mapbox: define-attribute-vertex-shader-only highp vec4 pbr\n#pragma mapbox: define-attribute-vertex-shader-only highp vec3 heightBasedEmissiveStrength\nuniform mat4 u_matrix;uniform mat4 u_node_matrix;uniform mat4 u_lighting_matrix;uniform vec3 u_camera_pos;uniform vec4 u_color_mix;\n#ifdef INSTANCED_ARRAYS\nin vec4 a_normal_matrix0;in vec4 a_normal_matrix1;in vec4 a_normal_matrix2;in vec4 a_normal_matrix3;\n#else\nuniform highp mat4 u_normal_matrix;\n#endif\n#ifdef RENDER_SHADOWS\nuniform mat4 u_light_matrix_0;uniform mat4 u_light_matrix_1;out highp vec4 v_pos_light_view_0;out highp vec4 v_pos_light_view_1;out float v_depth_shadows;\n#endif\nout vec4 v_position_height;out lowp vec4 v_color_mix;\n#ifdef TERRAIN_FRAGMENT_OCCLUSION\nout highp float v_depth;\n#endif\n#ifdef HAS_ATTRIBUTE_a_pbr\nout lowp vec4 v_roughness_metallic_emissive_alpha;out mediump vec4 v_height_based_emission_params;\n#endif\nvec3 sRGBToLinear(vec3 srgbIn) {return pow(srgbIn,vec3(2.2));}void main() {\n#pragma mapbox: initialize-attribute highp vec3 normal_3f\n#pragma mapbox: initialize-attribute highp vec2 uv_2f\n#pragma mapbox: initialize-attribute highp vec3 color_3f\n#pragma mapbox: initialize-attribute highp vec4 color_4f\n#pragma mapbox: initialize-attribute-custom highp vec4 pbr\n#pragma mapbox: initialize-attribute-custom highp vec3 heightBasedEmissiveStrength\nhighp mat4 normal_matrix;\n#ifdef INSTANCED_ARRAYS\nnormal_matrix=mat4(a_normal_matrix0,a_normal_matrix1,a_normal_matrix2,a_normal_matrix3);\n#else\nnormal_matrix=u_normal_matrix;\n#endif\nvec3 local_pos;mat3 rs;\n#ifdef MODEL_POSITION_ON_GPU\nvec3 pos_color=normal_matrix[0].xyz;vec4 translate=normal_matrix[1];vec3 pos_a=floor(pos_color);vec3 rgb=1.05*(pos_color-pos_a);float hidden=float(pos_a.x > EXTENT);float color_mix=pos_a.z/100.0;v_color_mix=vec4(sRGBToLinear(rgb),color_mix);float meter_to_tile=normal_matrix[0].w;vec4 pos=vec4(pos_a.xy,translate.z,1.0);rs[0].x=normal_matrix[1].w;rs[0].yz=normal_matrix[2].xy;rs[1].xy=normal_matrix[2].zw;rs[1].z=normal_matrix[3].x;rs[2].xyz=normal_matrix[3].yzw;vec4 pos_node=u_lighting_matrix*vec4(a_pos_3f,1.0);vec3 rotated_pos_node=rs*pos_node.xyz;vec3 pos_model_tile=(rotated_pos_node+vec3(translate.xy,0.0))*vec3(meter_to_tile,meter_to_tile,1.0);pos.xyz+=pos_model_tile;local_pos=pos.xyz;gl_Position=mix(u_matrix*pos,AWAY,hidden);pos.z*=meter_to_tile;v_position_height.xyz=pos.xyz-u_camera_pos;\n#else\nlocal_pos=a_pos_3f;gl_Position=u_matrix*vec4(a_pos_3f,1);v_position_height.xyz=vec3(u_lighting_matrix*vec4(a_pos_3f,1));v_color_mix=vec4(sRGBToLinear(u_color_mix.rgb),u_color_mix.a);\n#endif\nv_position_height.w=a_pos_3f.z;\n#ifdef HAS_ATTRIBUTE_a_pbr\nvec4 albedo_c=decode_color(pbr.xy);vec2 e_r_m=unpack_float(pbr.z);vec2 r_m= unpack_float(e_r_m.y*16.0);r_m.r=r_m.r*16.0;v_color_mix=vec4(albedo_c.rgb,1.0);v_roughness_metallic_emissive_alpha=vec4(vec3(r_m,e_r_m.x)/255.0,albedo_c.a);v_roughness_metallic_emissive_alpha.z*=2.0;float heightBasedRelativeIntepolation=a_pos_3f.z*heightBasedEmissiveStrength.x+heightBasedEmissiveStrength.y;v_height_based_emission_params.x=heightBasedRelativeIntepolation;v_height_based_emission_params.y=heightBasedEmissiveStrength.z;vec2 emissionMultiplierValues=unpack_float(pbr.w)/256.0;v_height_based_emission_params.z=emissionMultiplierValues.x;v_height_based_emission_params.w=emissionMultiplierValues.y-emissionMultiplierValues.x;\n#endif\n#ifdef FOG\nv_fog_pos=fog_position(local_pos);\n#endif\n#ifdef RENDER_CUTOFF\nv_cutoff_opacity=cutoff_opacity(u_cutoff_params,gl_Position.z);\n#endif\n#ifdef TERRAIN_FRAGMENT_OCCLUSION\nv_depth=gl_Position.z/gl_Position.w;\n#endif\n#ifdef HAS_ATTRIBUTE_a_normal_3f\n#ifdef MODEL_POSITION_ON_GPU\nfloat x_squared_scale=dot(rs[0],rs[0]);float y_squared_scale=dot(rs[1],rs[1]);float z_squared_scale=dot(rs[2],rs[2]);vec3 squared_scale=vec3(x_squared_scale,y_squared_scale,z_squared_scale);normal_3f=rs*((u_lighting_matrix*vec4(normal_3f,0.0)).xyz/squared_scale);normal_3f=normalize(normal_3f);\n#else\nnormal_3f=vec3(normal_matrix*vec4(normal_3f,0));\n#endif\n#endif\n#ifdef HAS_ATTRIBUTE_a_pbr\n#ifdef HAS_ATTRIBUTE_a_color_4f\nv_roughness_metallic_emissive_alpha.w=clamp(color_4f.a*v_roughness_metallic_emissive_alpha.w*(v_roughness_metallic_emissive_alpha.z-1.0),0.0,1.0);\n#endif\n#endif\n#ifdef RENDER_SHADOWS\nvec4 shadow_pos=u_node_matrix*vec4(local_pos,1.0);\n#ifdef NORMAL_OFFSET\n#ifdef HAS_ATTRIBUTE_a_normal_3f\n#ifdef MODEL_POSITION_ON_GPU\nvec3 offset=shadow_normal_offset(vec3(-normal_3f.xy,normal_3f.z));shadow_pos.xyz+=offset*shadow_normal_offset_multiplier0();\n#else\nvec3 offset=shadow_normal_offset_model(normal_3f);shadow_pos.xyz+=offset*shadow_normal_offset_multiplier0();\n#endif\n#endif\n#endif\nv_pos_light_view_0=u_light_matrix_0*shadow_pos;v_pos_light_view_1=u_light_matrix_1*shadow_pos;v_depth_shadows=gl_Position.w;\n#endif\n}'),modelDepth:Pt("in highp float v_depth;void main() {\n#ifndef DEPTH_TEXTURE\nglFragColor=pack_depth(v_depth);\n#endif\n}","in vec3 a_pos_3f;uniform mat4 u_matrix;out highp float v_depth;\n#ifdef MODEL_POSITION_ON_GPU\n#ifdef INSTANCED_ARRAYS\nin vec4 a_normal_matrix0;in vec4 a_normal_matrix1;in vec4 a_normal_matrix2;in vec4 a_normal_matrix3;\n#else\nuniform highp mat4 u_instance;\n#endif\nuniform highp mat4 u_node_matrix;\n#endif\nvoid main() {\n#ifdef MODEL_POSITION_ON_GPU\nhighp mat4 instance;\n#ifdef INSTANCED_ARRAYS\ninstance=mat4(a_normal_matrix0,a_normal_matrix1,a_normal_matrix2,a_normal_matrix3);\n#else\ninstance=u_instance;\n#endif\nvec3 pos_color=instance[0].xyz;vec4 translate=instance[1];vec3 pos_a=floor(pos_color);float hidden=float(pos_a.x > EXTENT);float meter_to_tile=instance[0].w;vec4 pos=vec4(pos_a.xy,translate.z,1.0);mat3 rs;rs[0].x=instance[1].w;rs[0].yz=instance[2].xy;rs[1].xy=instance[2].zw;rs[1].z=instance[3].x;rs[2].xyz=instance[3].yzw;vec4 pos_node=u_node_matrix*vec4(a_pos_3f,1.0);vec3 rotated_pos_node=rs*pos_node.xyz;vec3 pos_model_tile=(rotated_pos_node+vec3(translate.xy,0.0))*vec3(meter_to_tile,meter_to_tile,1.0);pos.xyz+=pos_model_tile;gl_Position=mix(u_matrix*pos,AWAY,hidden);\n#else\ngl_Position=u_matrix*vec4(a_pos_3f,1);\n#endif\nv_depth=gl_Position.z/gl_Position.w;}"),stars:Pt("in highp vec2 v_uv;in mediump float v_intensity;float shapeCircle(in vec2 uv)\n{float beginFade=0.6;float lengthFromCenter=length(v_uv);return 1.0-clamp((lengthFromCenter-beginFade)/(1.0-beginFade),0.0,1.0);}void main() {float alpha=shapeCircle(v_uv);vec3 color=vec3(1.0,1.0,1.0);alpha*=v_intensity;glFragColor=vec4(color*alpha,alpha);HANDLE_WIREFRAME_DEBUG;}","\nin vec3 a_pos_3f;in vec2 a_uv;in float a_size_scale;in float a_fade_opacity;uniform mat4 u_matrix;uniform vec3 u_up;uniform vec3 u_right;uniform float u_intensity_multiplier;out highp vec2 v_uv;out mediump float v_intensity;void main() {v_uv=a_uv;v_intensity=a_fade_opacity*u_intensity_multiplier;vec3 pos=a_pos_3f;pos+=a_uv.x*u_right*a_size_scale;pos+=a_uv.y*u_up*a_size_scale;gl_Position=u_matrix*vec4(pos,1.0);}"),occlusion:Pt("uniform vec4 u_color;void main() {glFragColor=u_color;}",'#include "_prelude_terrain.vertex.glsl"\nin highp vec2 a_offset_xy;uniform highp vec3 u_anchorPos;uniform mat4 u_matrix;uniform vec2 u_screenSizePx;uniform vec2 u_occluderSizePx;void main() {vec3 world_pos=u_anchorPos;\n#ifdef TERRAIN\nfloat e=elevation(world_pos.xy);world_pos.z+=e;\n#endif\nvec4 projected_point=u_matrix*vec4(world_pos,1.0);projected_point.xy+=projected_point.w*a_offset_xy*0.5*u_occluderSizePx/u_screenSizePx;gl_Position=projected_point;}')};function Ct(e,t){const i=e.replace(/\s*\/\/[^\n]*\n/g,"\n").split("\n");for(let e of i)if(e=e.trim(),"#"===e[0]&&e.includes("if")&&!e.includes("endif")){e=e.replace("#","").replace(/ifdef|ifndef|elif|if/g,"").replace(/!|defined|\(|\)|\|\||&&/g,"").replace(/\s+/g," ").trim();const i=e.split(" ");for(const e of i)t.includes(e)||t.push(e)}}function Pt(e,t){const i=/#include\s+"([^"]+)"/g,r=/#pragma mapbox: ([\w\-]+) ([\w]+) ([\w]+) ([\w]+)/g;let n=t.match(/(attribute(\S*)|(^\s*|;)in) (highp |mediump |lowp )?([\w]+) ([\w]+)/gm);n&&(n=n.map((e=>{const t=e.split(" ");return t[t.length-1]})),n=[...new Set(n)]);const o={},s=[],a=[];if(e=e.replace(i,((e,t)=>(a.push(t),""))),(t=t.replace(i,((e,t)=>(s.push(t),"")))).includes("flat out"))return void console.error('The usage of "flat" qualifier is disallowed, see: https://bugs.webkit.org/show_bug.cgi?id=268071');let l=[...Tt];Ct(e,l),Ct(t,l);for(const e of[...s,...a])Et[e]||console.error(`Undefined include: ${e}`),St[e]||(St[e]=[],Ct(Et[e],St[e])),l=[...l,...St[e]];return{fragmentSource:e=e.replace(r,((e,t,i,r,n)=>(o[n]=!0,"define"===t?`\n#ifndef HAS_UNIFORM_u_${n}\nin ${i} ${r} ${n};\n#else\nuniform ${i} ${r} u_${n};\n#endif\n`:"initialize"===t?`\n#ifdef HAS_UNIFORM_u_${n}\n ${i} ${r} ${n} = u_${n};\n#endif\n`:"define-attribute"===t?`\n#ifdef HAS_ATTRIBUTE_a_${n}\n in ${i} ${r} ${n};\n#endif\n`:"initialize-attribute"===t?"":void 0))),vertexSource:t=t.replace(r,((e,t,i,r,n)=>{const s="float"===r?"vec2":r,a=n.match(/color/)?"color":s;return"define-attribute-vertex-shader-only"===t?`\n#ifdef HAS_ATTRIBUTE_a_${n}\nin ${i} ${r} a_${n};\n#endif\n`:o[n]?"define"===t?`\n#ifndef HAS_UNIFORM_u_${n}\nuniform lowp float u_${n}_t;\nin ${i} ${s} a_${n};\nout ${i} ${r} ${n};\n#else\nuniform ${i} ${r} u_${n};\n#endif\n`:"initialize"===t?"vec4"===a?`\n#ifndef HAS_UNIFORM_u_${n}\n ${n} = a_${n};\n#else\n ${i} ${r} ${n} = u_${n};\n#endif\n`:`\n#ifndef HAS_UNIFORM_u_${n}\n ${n} = unpack_mix_${a}(a_${n}, u_${n}_t);\n#else\n ${i} ${r} ${n} = u_${n};\n#endif\n`:"define-attribute"===t?`\n#ifdef HAS_ATTRIBUTE_a_${n}\n in ${i} ${r} a_${n};\n out ${i} ${r} ${n};\n#endif\n`:"initialize-attribute"===t?`\n#ifdef HAS_ATTRIBUTE_a_${n}\n ${n} = a_${n};\n#endif\n`:void 0:"define"===t?`\n#ifndef HAS_UNIFORM_u_${n}\nuniform lowp float u_${n}_t;\nin ${i} ${s} a_${n};\n#else\nuniform ${i} ${r} u_${n};\n#endif\n`:"define-instanced"===t?"mat4"===a?`\n#ifdef INSTANCED_ARRAYS\nin vec4 a_${n}0;\nin vec4 a_${n}1;\nin vec4 a_${n}2;\nin vec4 a_${n}3;\n#else\nuniform ${i} ${r} u_${n};\n#endif\n`:`\n#ifdef INSTANCED_ARRAYS\nin ${i} ${s} a_${n};\n#else\nuniform ${i} ${r} u_${n};\n#endif\n`:"initialize-attribute-custom"===t?`\n#ifdef HAS_ATTRIBUTE_a_${n}\n ${i} ${r} ${n} = a_${n};\n#endif\n`:"vec4"===a?`\n#ifndef HAS_UNIFORM_u_${n}\n ${i} ${r} ${n} = a_${n};\n#else\n ${i} ${r} ${n} = u_${n};\n#endif\n`:`\n#ifndef HAS_UNIFORM_u_${n}\n ${i} ${r} ${n} = unpack_mix_${a}(a_${n}, u_${n}_t);\n#else\n ${i} ${r} ${n} = u_${n};\n#endif\n`})),staticAttributes:n,usedDefines:l,vertexIncludes:s,fragmentIncludes:a}}class zt{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffers=[],this.vao=null}bind(e,t,i,r,n,o,s,a){this.context=e;let l=this.boundPaintVertexBuffers.length!==r.length;for(let e=0;!l&&e{const o=r.paint.get("hillshade-shadow-color"),s=r.paint.get("hillshade-highlight-color"),a=r.paint.get("hillshade-accent-color"),l=r.paint.get("hillshade-emissive-strength");let c=e.ac(r.paint.get("hillshade-illumination-direction"));if("viewport"===r.paint.get("hillshade-illumination-anchor"))c-=t.transform.angle;else if(t.style&&t.style.enable3dLights()&&t.style.directionalLight){const i=t.style.directionalLight.properties.get("direction"),r=e.ad(i.x,i.y,i.z);c=e.ac(r[1])}const h=!t.options.moving;return{u_matrix:n||t.transform.calculateProjMatrix(i.tileID.toUnwrapped(),h),u_image:0,u_latrange:Dt(0,i.tileID),u_light:[r.paint.get("hillshade-exaggeration"),c],u_shadow:o.toRenderColor(r.lut),u_highlight:s.toRenderColor(r.lut),u_emissive_strength:l,u_accent:a.toRenderColor(r.lut)}})(t,r,n,t.terrain?i.projMatrix:null);t.uploadCommonUniforms(l,d,i.toUnwrapped());const{tileBoundsBuffer:f,tileBoundsIndexBuffer:m,tileBoundsSegments:_}=t.getTileBoundsBuffers(r);d.draw(t,c.TRIANGLES,o,s,a,e.ag.disabled,p,n.id,f,m,_)}function Lt(t,i,r){if(!i.needsDEMTextureUpload)return;const n=t.context,o=n.gl;n.pixelStoreUnpackPremultiplyAlpha.set(!1),i.demTexture=i.demTexture||t.getTileTexture(r.stride);const s=r.getPixels();i.demTexture?i.demTexture.update(s,{premultiply:!1}):i.demTexture=new e.T(n,s,o.R32F,{premultiply:!1}),i.needsDEMTextureUpload=!1}function kt(t,i,r){const n=t.context,o=n.gl;if(!i.dem)return;const s=i.dem;if(n.activeTexture.set(o.TEXTURE1),Lt(t,i,s),!i.demTexture)return;i.demTexture.bind(o.NEAREST,o.CLAMP_TO_EDGE);const a=s.dim;n.activeTexture.set(o.TEXTURE0);let l=i.hillshadeFBO;if(!l){const t=new e.T(n,{width:a,height:a,data:null},o.RGBA);t.bind(o.LINEAR,o.CLAMP_TO_EDGE),l=i.hillshadeFBO=n.createFramebuffer(a,a,!0,"renderbuffer"),l.colorAttachment.set(t.texture)}n.bindFramebuffer.set(l.framebuffer),n.viewport.set([0,0,a,a]);const{tileBoundsBuffer:c,tileBoundsIndexBuffer:h,tileBoundsSegments:u}=t.getMercatorTileBoundsBuffers(),d=[];t.linearFloatFilteringSupported()&&d.push("TERRAIN_DEM_FLOAT_FORMAT"),t.getOrCreateProgram("hillshadePrepare",{defines:d}).draw(t,o.TRIANGLES,e.af.disabled,e.ah.disabled,e.a.unblended,e.ag.disabled,((t,i)=>{const r=i.stride,n=e.ae.create();return e.ae.ortho(n,0,e.a4,-e.a4,0,0,1),e.ae.translate(n,n,[0,-e.a4,0]),{u_matrix:n,u_image:1,u_dimension:[r,r],u_zoom:t.overscaledZ}})(i.tileID,s),r.id,c,h,u),i.needsHillshadePrepare=!1}function Ot(t,i,r,n,o){const s=function(r,n){if(r)return o(r);if(n){if(t.url&&n.tiles&&t.tiles&&delete t.tiles,n.variants){if(!Array.isArray(n.variants))return o(new Error("variants must be an array"));for(const t of n.variants){if(null==t||"object"!=typeof t||t.constructor!==Object)return o(new Error("variant must be an object"));if(!Array.isArray(t.capabilities))return o(new Error("capabilities must be an array"));if(1===t.capabilities.length&&"meshopt"===t.capabilities[0]){n=e.Q(n,t);break}}}const r=e.ai(e.Q(n,t),["tilejson","tiles","minzoom","maxzoom","attribution","mapbox_logo","bounds","scheme","tileSize","encoding"]);n.vector_layers&&(r.vectorLayers=n.vector_layers,r.vectorLayerIds=r.vectorLayers.map((e=>e.id))),n.raster_layers&&(r.rasterLayers=n.raster_layers,r.rasterLayerIds=r.rasterLayers.map((e=>e.id))),r.tiles=i.canonicalizeTileset(r,t.url),o(null,r)}},l=(function(e,t,i){if(!e)return null;if(!t&&!i)return e;i=i||e.worldview_default;const r=Object.values(e.language||{});if(0===r.length)return null;const n=Object.values(e.worldview||{});if(0===n.length)return null;const o=r.every((e=>e===t)),s=n.every((e=>e===i));return o&&s?e:t in(e.language_options||{})||i in(e.worldview_options||{})?null:e.language_options&&e.worldview_options?e:null})(t.data,r,n);return l?e.e.frame((()=>s(null,l))):t.url?e.h(i.transformRequest(i.normalizeSourceURL(t.url,null,r,n),e.R.Source),s):e.e.frame((()=>{const e=a(t,c);s(null,e)}))}class Bt{constructor(t,i,r){this.bounds=e.aj.convert(this.validateBounds(t)),this.minzoom=i||0,this.maxzoom=r||24}validateBounds(e){return Array.isArray(e)&&4===e.length?[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(t){const i=Math.pow(2,t.z),r=Math.floor(e.ak(this.bounds.getWest())*i),n=Math.floor(e.al(this.bounds.getNorth())*i),o=Math.ceil(e.ak(this.bounds.getEast())*i),s=Math.ceil(e.al(this.bounds.getSouth())*i);return t.x>=r&&t.x=n&&t.y{this._tileJSONRequest=null,this._loaded=!0,i?this.fire(new e.f(i)):r&&(e.Q(this,r),r.bounds&&(this.tileBounds=new Bt(r.bounds,this.minzoom,this.maxzoom)),e.ao(r.tiles),this.fire(new e.g("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new e.g("data",{dataType:"source",sourceDataType:"content"}))),t&&t(i)}))}loaded(){return this._loaded}onAdd(e){this.map=e,this.load()}reload(){this.cancelTileJSONRequest();const t=e.am(this.id,this.scope);this.load((()=>this.map.style.clearSource(t)))}setTiles(e){return this._options.tiles=e,this.reload(),this}setUrl(e){return this.url=e,this._options.url=e,this.reload(),this}onRemove(e){this.cancelTileJSONRequest()}serialize(){return e.Q({},this._options)}hasTile(e){return!this.tileBounds||this.tileBounds.contains(e.canonical)}loadTile(t,i){const r=e.e.devicePixelRatio>=2,n=this.map._requestManager.normalizeTileURL(t.tileID.canonical.url(this.tiles,this.scheme),r,this.tileSize);t.request=e.i(this.map._requestManager.transformRequest(n,e.R.Tile),((r,n,o,s)=>(delete t.request,t.aborted?(t.state="unloaded",i(null)):r?(t.state="errored",i(r)):n?(this.map._refreshExpiredTiles&&t.setExpiryData({cacheControl:o,expires:s}),t.setTexture(n,this.map.painter),t.state="loaded",e.an(this.dispatcher),void i(null)):i(null))))}abortTile(e,t){e.request&&(e.request.cancel(),delete e.request),t&&t()}unloadTile(t,i){t.texture&&t.texture instanceof e.T?(t.destroy(!0),t.texture&&t.texture instanceof e.T&&this.map.painter.saveTileTexture(t.texture)):t.destroy(),i&&i()}hasTransition(){return!1}cancelTileJSONRequest(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}}class Nt extends e.E{constructor(t,i,r,n){if(super(),this.id=t,this.dispatcher=r,this.type="vector",this.minzoom=0,this.maxzoom=22,this.scheme="xyz",this.tileSize=512,this.reparseOverscaled=!0,this.isTileClipped=!0,this._loaded=!1,e.Q(this,e.ai(i,["url","scheme","tileSize","promoteId"])),this._options=e.Q({type:"vector"},i),this._collectResourceTiming=!!i.collectResourceTiming,512!==this.tileSize)throw new Error("vector tile sources must have a tileSize of 512");this.setEventedParent(n),this._tileWorkers={},this._deduped=new e.ap}load(t){this._loaded=!1,this.fire(new e.g("dataloading",{dataType:"source"}));const i=Array.isArray(this.map._language)?this.map._language.join():this.map._language,r=this.map._worldview;this._tileJSONRequest=Ot(this._options,this.map._requestManager,i,r,((n,o)=>{this._tileJSONRequest=null,this._loaded=!0,n?(i&&console.warn(`Ensure that your requested language string is a valid BCP-47 code or list of codes. Found: ${i}`),r&&2!==r.length&&console.warn(`Requested worldview strings must be a valid ISO alpha-2 code. Found: ${r}`),this.fire(new e.f(n))):o&&(e.Q(this,o),o.bounds&&(this.tileBounds=new Bt(o.bounds,this.minzoom,this.maxzoom)),e.ao(o.tiles,this.map._requestManager._customAccessToken),this.fire(new e.g("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new e.g("data",{dataType:"source",sourceDataType:"content"}))),t&&t(n)}))}loaded(){return this._loaded}hasTile(e){return!this.tileBounds||this.tileBounds.contains(e.canonical)}onAdd(e){this.map=e,this.load()}reload(){this.cancelTileJSONRequest();const t=e.am(this.id,this.scope);this.load((()=>this.map.style.clearSource(t)))}setTiles(e){return this._options.tiles=e,this.reload(),this}setUrl(e){return this.url=e,this._options.url=e,this.reload(),this}onRemove(e){this.cancelTileJSONRequest()}serialize(){return e.Q({},this._options)}loadTile(t,i){const r=this.map._requestManager.normalizeTileURL(t.tileID.canonical.url(this.tiles,this.scheme)),n=this.map._requestManager.transformRequest(r,e.R.Tile),o=this.map.style?this.map.style.getLut(this.scope):null,s={request:n,data:void 0,uid:t.uid,tileID:t.tileID,tileZoom:t.tileZoom,zoom:t.tileID.overscaledZ,lut:o?{image:o.image.clone()}:null,tileSize:this.tileSize*t.tileID.overscaleFactor(),type:this.type,source:this.id,scope:this.scope,pixelRatio:e.e.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId,isSymbolTile:t.isSymbolTile,brightness:this.map.style&&this.map.style.getBrightness()||0,extraShadowCaster:t.isExtraShadowCaster,tessellationStep:this.map._tessellationStep};if(s.request.collectResourceTiming=this._collectResourceTiming,t.actor&&"expired"!==t.state)"loading"===t.state?t.reloadCallback=i:t.request=t.actor.send("reloadTile",s,a.bind(this));else if(t.actor=this._tileWorkers[r]=this._tileWorkers[r]||this.dispatcher.getActor(),this.dispatcher.ready)t.request=t.actor.send("loadTile",s,a.bind(this),void 0,!0);else{const i=e.aq.call({deduped:this._deduped},s,((e,i)=>{e||!i?a.call(this,e):(s.data={cacheControl:i.cacheControl,expires:i.expires,rawData:i.rawData.slice(0)},t.actor&&t.actor.send("loadTile",s,a.bind(this),void 0,!0))}),!0);t.request={cancel:i}}function a(r,n){return delete t.request,t.aborted?i(null):r&&404!==r.status?i(r):(n&&n.resourceTiming&&(t.resourceTiming=n.resourceTiming),this.map._refreshExpiredTiles&&n&&t.setExpiryData(n),t.loadVectorData(n,this.map.painter),e.an(this.dispatcher),i(null),void(t.reloadCallback&&(this.loadTile(t,t.reloadCallback),t.reloadCallback=null)))}}abortTile(e){e.request&&(e.request.cancel(),delete e.request),e.actor&&e.actor.send("abortTile",{uid:e.uid,type:this.type,source:this.id,scope:this.scope})}unloadTile(e,t){e.actor&&e.actor.send("removeTile",{uid:e.uid,type:this.type,source:this.id,scope:this.scope}),e.destroy()}hasTransition(){return!1}afterUpdate(){this._tileWorkers={}}cancelTileJSONRequest(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}}const Vt=(e,t,i)=>({u_matrix:e,u_image0:0,u_skirt_height:t,u_ground_shadow_factor:i}),Ut=(e,t,i,r,n,o,s,a,l,c,h,u,d,p,f,m)=>({u_proj_matrix:Float32Array.from(e),u_globe_matrix:t,u_normalize_matrix:Float32Array.from(r),u_merc_matrix:i,u_zoom_transition:n,u_merc_center:o,u_image0:0,u_frustum_tl:s,u_frustum_tr:a,u_frustum_br:l,u_frustum_bl:c,u_globe_pos:h,u_globe_radius:u,u_viewport:d,u_grid_matrix:m?Float32Array.from(m):new Float32Array(9),u_skirt_height:p,u_far_z_cutoff:f});class jt{constructor(e=0,t=0,i=0,r=0){if(isNaN(e)||e<0||isNaN(t)||t<0||isNaN(i)||i<0||isNaN(r)||r<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=e,this.bottom=t,this.left=i,this.right=r}interpolate(t,i,r){return null!=i.top&&null!=t.top&&(this.top=e.a3(t.top,i.top,r)),null!=i.bottom&&null!=t.bottom&&(this.bottom=e.a3(t.bottom,i.bottom,r)),null!=i.left&&null!=t.left&&(this.left=e.a3(t.left,i.left,r)),null!=i.right&&null!=t.right&&(this.right=e.a3(t.right,i.right,r)),this}getCenter(t,i){const r=e.au((this.left+t-this.right)/2,0,t),n=e.au((this.top+i-this.bottom)/2,0,i);return new e.P(r,n)}equals(e){return this.top===e.top&&this.bottom===e.bottom&&this.left===e.left&&this.right===e.right}clone(){return new jt(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}function $t(t,i){const r=e.ax(t,3);e.ae.fromQuat(t,i),e.aA(t,3,r)}function Gt(t,i){const r=e.aw.identity([]);return e.aw.rotateZ(r,r,-i),e.aw.rotateX(r,r,-t),r}function qt(t,i){const r=[t[0],t[1],0],n=[i[0],i[1],0];if(e.$.length(r)>=1e-15){const t=e.$.normalize([],r);e.$.scale(n,t,e.$.dot(n,t)),i[0]=n[0],i[1]=n[1]}const o=e.$.cross([],i,t);if(e.$.len(o)<1e-15)return null;const s=Math.atan2(-o[1],o[0]);return Gt(Math.atan2(Math.sqrt(t[0]*t[0]+t[1]*t[1]),-t[2]),s)}class Zt{constructor(e,t){this.position=e,this.orientation=t}get position(){return this._position}set position(t){if(t){const i=t instanceof e._?t:new e._(t[0],t[1],t[2]);this._renderWorldCopies&&(i.x=e.av(i.x,0,1)),this._position=i}else this._position=null}lookAtPoint(t,i){if(this.orientation=null,!this.position)return;const r=this.position,n=this._elevation?this._elevation.getAtPointOrZero(e._.fromLngLat(t)):0,o=e._.fromLngLat(t,n),s=[o.x-r.x,o.y-r.y,o.z-r.z];i||(i=[0,0,1]),i[2]=Math.abs(i[2]),this.orientation=qt(s,i)}setPitchBearing(t,i){this.orientation=Gt(e.ac(t),e.ac(-i))}}class Wt{constructor(t,i){this._transform=e.ae.identity([]),this.orientation=i,this.position=t}get mercatorPosition(){const t=this.position;return new e._(t[0],t[1],t[2])}get position(){const t=e.ax(this._transform,3);return[t[0],t[1],t[2]]}set position(t){var i;t&&e.aA(this._transform,3,[(i=t)[0],i[1],i[2],1])}get orientation(){return this._orientation}set orientation(t){this._orientation=t||e.aw.identity([]),t&&$t(this._transform,this._orientation)}getPitchBearing(){const e=this.forward(),t=this.right();return{bearing:Math.atan2(-t[1],t[0]),pitch:Math.atan2(Math.sqrt(e[0]*e[0]+e[1]*e[1]),-e[2])}}setPitchBearing(e,t){this._orientation=Gt(e,t),$t(this._transform,this._orientation)}forward(){const t=e.ax(this._transform,2);return[-t[0],-t[1],-t[2]]}up(){const t=e.ax(this._transform,1);return[-t[0],-t[1],-t[2]]}right(){const t=e.ax(this._transform,0);return[t[0],t[1],t[2]]}getCameraToWorld(t,i){const r=new Float64Array(16);return e.ae.invert(r,this.getWorldToCamera(t,i)),r}getCameraToWorldMercator(){return this._transform}getWorldToCameraPosition(t,i,r){const n=this.position;e.$.scale(n,n,-t);const o=new Float64Array(16);return e.ae.fromScaling(o,[r,r,r]),e.ae.translate(o,o,n),o[10]*=i,o}getWorldToCamera(t,i){const r=new Float64Array(16),n=new Float64Array(4),o=this.position;return e.aw.conjugate(n,this._orientation),e.$.scale(o,o,-t),e.ae.fromQuat(r,n),e.ae.translate(r,r,o),r[1]*=-1,r[5]*=-1,r[9]*=-1,r[13]*=-1,r[8]*=i,r[9]*=i,r[10]*=i,r[11]*=i,r}getCameraToClipPerspective(t,i,r,n){const o=new Float64Array(16);return e.ae.perspective(o,t,i,r,n),o}getCameraToClipOrthographic(t,i,r,n,o,s){const a=new Float64Array(16);return e.ae.ortho(a,t,i,r,n,o,s),a}getDistanceToElevation(t,i=!1){const r=0===t?0:e.ay(t,i?e.az(this.position[1]):this.position[1]),n=this.forward();return(r-this.position[2])/n[2]}clone(){return new Wt([...this.position],[...this.orientation])}}const Ht={unknown:0,flipRequired:1,flipNotRequired:2},Xt=Math.tan(85*Math.PI/180);function Yt(t,i,r,n,o,s,a){const l=e.ae.create();if(r)if("globe"===s.name){const t=e.aC(o,i);e.ae.multiply(l,l,t)}else{const t=e.aD.invert([],a);l[0]=t[0],l[1]=t[1],l[4]=t[2],l[5]=t[3],n||e.ae.rotateZ(l,l,o.angle)}else e.ae.multiply(l,o.labelPlaneMatrix,t);return l}function Jt(e,t,i,r,n,o,s){const a=Yt(e,t,i,r,n,o,s);return"globe"===o.name&&i||(a[2]=a[6]=a[10]=a[14]=0),a}function Kt(t,i,r,n,o,s,a){if(r){if("globe"===s.name){const l=Yt(t,i,r,n,o,s,a);return e.ae.invert(l,l),e.ae.multiply(l,t,l),l}{const i=e.ae.clone(t),r=e.ae.identity([]);return r[0]=a[0],r[1]=a[1],r[4]=a[2],r[5]=a[3],e.ae.multiply(i,i,r),n||e.ae.rotateZ(i,i,-o.angle),i}}return o.glCoordMatrix}function Qt(t,i,r,n){const o=[t,i,r,1];r?e.aB.transformMat4(o,o,n):hi(o,o,n);const s=o[3];return o[0]/=s,o[1]/=s,o[2]/=s,o}function ei(e,t){return Math.min(.5+e/t*.5,1.5)}function ti(e,t){const i=e[0]/e[3],r=e[1]/e[3];return i>=-t[0]&&i<=t[0]&&r>=-t[1]&&r<=t[1]}function ii(t,i,r,n,o,s,a,l,c,h){const u=r.transform,d=n?t.textSizeData:t.iconSizeData,p=e.aE(d,r.transform.zoom),f="globe"===u.projection.name,m=[256/r.width*2+1,256/r.height*2+1],_=n?t.text.dynamicLayoutVertexArray:t.icon.dynamicLayoutVertexArray;_.clear();let g=null;f&&(g=n?t.text.globeExtVertexArray:t.icon.globeExtVertexArray);const y=t.lineVertexArray,x=n?t.text.placedSymbolArray:t.icon.placedSymbolArray,v=r.transform.width/r.transform.height;let b,w=!1;for(let n=0;nMath.abs(r)?{useVertical:!0}:t===e.aF.vertical?n>0?{needsFlipping:!0}:null:i!==Ht.unknown&&(function(e,t){return 0===e||Math.abs(t/e)>Xt})(r,n)?i===Ht.flipRequired?{needsFlipping:!0}:null:r<0?{needsFlipping:!0}:null}function oi(t,i,r,n,o,s,a,l,c,h,u,d,p,f,m,_,g,y,x){const v=i/24,b=t.lineOffsetX*v,w=t.lineOffsetY*v,{lineStartIndex:T,glyphStartIndex:E,numGlyphs:S,segment:M,writingMode:A,flipState:I}=t,C=T+t.lineLength,P=t=>{if(u){const[i,r,n]=t.up,o=h.length;e.aH(u,o+0,i,r,n),e.aH(u,o+1,i,r,n),e.aH(u,o+2,i,r,n),e.aH(u,o+3,i,r,n)}const[i,r,n]=t.point;e.aI(h,i,r,n,t.angle)};if(S>1){const e=ri(v,l,b,w,r,d,p,t,c,s,f,_,!1,g,y,x);if(!e)return{notEnoughRoom:!0};if(n&&!r){let[i,r,n]=e.first.point,[o,s,l]=e.last.point;[i,r]=Qt(i,r,n,a),[o,s]=Qt(o,s,l,a);const c=ni(A,I,(o-i)*m,s-r);if(t.flipState=c&&c.needsFlipping?Ht.flipRequired:Ht.flipNotRequired,c)return c}P(e.first);for(let e=E+1;e0?s:ai(p,n,i,1,o,void 0,g,y.canonical),l=ni(A,I,(a[0]-i[0])*m,a[1]-i[1]);if(t.flipState=l&&l.needsFlipping?Ht.flipRequired:Ht.flipNotRequired,l)return l}const i=li(v*l.getoffsetX(E),b,w,r,d,p,M,T,C,c,s,f,_,!1,!1,g,y,x);if(!i)return{notEnoughRoom:!0};P(i)}return{}}function si(e,t,i,r,n){const{x:o,y:s,z:a}=r.projectTilePoint(e.x,e.y,t);if(!n)return Qt(o,s,a,i);const[l,c,h]=n(e);return Qt(o+l,s+c,a+h,i)}function ai(t,i,r,n,o,s,a,l){const c=si(t.sub(i)._unit()._add(t),l,o,a,s);return e.$.sub(c,r,c),e.$.normalize(c,c),e.$.scaleAndAdd(c,r,c,n)}function li(t,i,r,n,o,s,a,l,c,h,u,d,p,f,m,_,g,y){const x=n?t-i:t+i;let v=x>0?1:-1,b=0;n&&(v*=-1,b=Math.PI),v<0&&(b+=Math.PI);let w=l+a+(v>0?0:1)|0,T=o,E=o,S=0,M=0;const A=Math.abs(x),I=[],C=[];let P=s,z=P;const D=()=>ai(z,P,E,A-S+1,u,p,_,g.canonical);for(;S+M<=A;){if(w+=v,w=c)return null;if(E=T,z=P,I.push(E),f&&C.push(z),P=new e.P(h.getx(w),h.gety(w)),T=d[w],!T){const e=si(P,g.canonical,u,_,p);T=e[3]>0?d[w]=e:D()}S+=M,M=e.$.distance(E,T)}m&&p&&(d[w]&&(T=D(),M=e.$.distance(E,T)),d[w]=T);const R=(A-S)/M,L=P.sub(z)._mult(R)._add(z),k=e.$.sub([],T,E),O=e.$.scaleAndAdd([],E,k,R);let B=[0,0,1],F=k[0],N=k[1];if(y&&(B=_.upVector(g.canonical,L.x,L.y),0!==B[0]||0!==B[1]||1!==B[2])){const t=[B[2],0,-B[0]],i=e.$.cross([],B,t);e.$.normalize(t,t),e.$.normalize(i,i),F=e.$.dot(k,t),N=e.$.dot(k,i)}if(r){const t=e.$.cross([],B,k);e.$.normalize(t,t),e.$.scaleAndAdd(O,O,t,r*v)}const V=b+Math.atan2(N,F);return I.push(O),f&&C.push(L),{point:O,angle:V,path:I,tilePath:C,up:B}}function ci(e,t){const i=t.length,r=i+4*e;t.resize(r),t.float32.fill(-1/0,4*i,4*r)}function hi(e,t,i){const r=t[0],n=t[1];return e[0]=i[0]*r+i[4]*n+i[12],e[1]=i[1]*r+i[5]*n+i[13],e[3]=i[3]*r+i[7]*n+i[15],e}const ui=(e,t,i)=>(1-i)*e+i*t,di=e=>e*e*e*e*e;class pi{constructor(t,i,r,n,o,s,a){this.tileSize=512,this._renderWorldCopies=void 0===o||o,this._minZoom=t||0,this._maxZoom=i||22,this._minPitch=r??0,this._maxPitch=n??60,this.setProjection(s),this.setMaxBounds(a),this.width=0,this.height=0,this._center=new e.aJ(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._nearZ=0,this._farZ=0,this._unmodified=!0,this._edgeInsets=new jt,this._projMatrixCache={},this._alignedProjMatrixCache={},this._fogTileMatrixCache={},this._expandedProjMatrixCache={},this._distanceTileDataCache={},this._camera=new Wt,this._centerAltitude=0,this._averageElevation=0,this.cameraElevationReference="ground",this._pixelsPerMercatorPixel=1,this.globeRadius=0,this.globeCenterInViewSpace=[0,0,0],this._tileCoverLift=0,this.freezeTileCoverage=!1,this._horizonShift=.1,this._orthographicProjectionAtLowPitch=!1}clone(){const e=new pi(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies,this.getProjection());return e._elevation=this._elevation,e._centerAltitude=this._centerAltitude,e._centerAltitudeValidForExaggeration=this._centerAltitudeValidForExaggeration,e.tileSize=this.tileSize,e.mercatorFromTransition=this.mercatorFromTransition,e.width=this.width,e.height=this.height,e.cameraElevationReference=this.cameraElevationReference,e._center=this._center,e._setZoom(this.zoom),e._seaLevelZoom=this._seaLevelZoom,e.angle=this.angle,e._fov=this._fov,e._pitch=this._pitch,e._nearZ=this._nearZ,e._farZ=this._farZ,e._averageElevation=this._averageElevation,e._orthographicProjectionAtLowPitch=this._orthographicProjectionAtLowPitch,e._unmodified=this._unmodified,e._edgeInsets=this._edgeInsets.clone(),e._camera=this._camera.clone(),e._calcMatrices(),e.freezeTileCoverage=this.freezeTileCoverage,e.frustumCorners=this.frustumCorners,e}get isOrthographic(){return"globe"!==this.projection.name&&this._orthographicProjectionAtLowPitch&&this.pitch<15}get elevation(){return this._elevation}set elevation(e){this._elevation!==e&&(this._elevation=e,this._updateCameraOnTerrain(),this._calcMatrices())}get depthOcclusionForSymbolsAndCircles(){return"globe"!==this.projection.name&&!this.isOrthographic}updateElevation(e,t=!1){const i=this._elevation&&this._elevation.exaggeration()!==this._centerAltitudeValidForExaggeration;(null==this._seaLevelZoom||i)&&this._updateCameraOnTerrain(),(e||i)&&this._constrainCamera(t),this._calcMatrices()}getProjection(){return e.ai(this.projection,["name","center","parallels"])}setProjection(t){this.projectionOptions=t||{name:"mercator"};const i=this.projection?this.getProjection():void 0;this.projection=e.aK(this.projectionOptions);const r=this.getProjection(),n=!e.d(i,r);return n&&this._calcMatrices(),this.mercatorFromTransition=!1,n}setOrthographicProjectionAtLowPitch(e){return this._orthographicProjectionAtLowPitch!==e&&(this._orthographicProjectionAtLowPitch=e,this._calcMatrices(),!0)}setMercatorFromTransition(){const t=this.projection.name;this.mercatorFromTransition=!0,this.projectionOptions={name:"mercator"},this.projection=e.aK({name:"mercator"});const i=t!==this.projection.name;return i&&this._calcMatrices(),i}get minZoom(){return this._minZoom}set minZoom(e){this._minZoom!==e&&(this._minZoom=e,this.zoom=Math.max(this.zoom,e))}get maxZoom(){return this._maxZoom}set maxZoom(e){this._maxZoom!==e&&(this._maxZoom=e,this.zoom=Math.min(this.zoom,e))}get minPitch(){return this._minPitch}set minPitch(e){this._minPitch!==e&&(this._minPitch=e,this.pitch=Math.max(this.pitch,e))}get maxPitch(){return this._maxPitch}set maxPitch(e){this._maxPitch!==e&&(this._maxPitch=e,this.pitch=Math.min(this.pitch,e))}get renderWorldCopies(){return this._renderWorldCopies&&!0===this.projection.supportsWorldCopies}set renderWorldCopies(e){void 0===e?e=!0:null===e&&(e=!1),this._renderWorldCopies=e}get worldSize(){return this.tileSize*this.scale}get cameraWorldSizeForFog(){const e=Math.max(this._camera.getDistanceToElevation(this._averageElevation),Number.EPSILON);return this._worldSizeFromZoom(this._zoomFromMercatorZ(e))}get cameraWorldSize(){const e=Math.max(this._camera.getDistanceToElevation(this._averageElevation,!0),Number.EPSILON);return this._worldSizeFromZoom(this._zoomFromMercatorZ(e))}get pixelsPerMeter(){return this.projection.pixelsPerMeter(this.center.lat,this.worldSize)}get cameraPixelsPerMeter(){return e.ay(1,this.center.lat)*this.cameraWorldSizeForFog}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new e.P(this.width,this.height)}get bearing(){return e.av(this.rotation,-180,180)}set bearing(e){this.rotation=e}get rotation(){return-this.angle/Math.PI*180}set rotation(t){const i=-t*Math.PI/180;this.angle!==i&&(this._unmodified=!1,this.angle=i,this._calcMatrices(),this.rotationMatrix=e.aD.create(),e.aD.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))}get pitch(){return this._pitch/Math.PI*180}set pitch(t){const i=e.au(t,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==i&&(this._unmodified=!1,this._pitch=i,this._calcMatrices())}get aspect(){return this.width/this.height}get fov(){return this._fov/Math.PI*180}get fovX(){return this._fov}get fovY(){const e=1/Math.tan(.5*this.fovX);return 2*Math.atan(1/this.aspect/e)}set fov(t){t=Math.max(.01,Math.min(60,t)),this._fov!==t&&(this._unmodified=!1,this._fov=e.ac(t),this._calcMatrices())}get averageElevation(){return this._averageElevation}set averageElevation(e){this._averageElevation=e,this._calcFogMatrices(),this._distanceTileDataCache={}}get zoom(){return this._zoom}set zoom(e){const t=Math.min(Math.max(e,this.minZoom),this.maxZoom);this._zoom!==t&&(this._unmodified=!1,this._setZoom(t),this._updateSeaLevelZoom(),this._constrain(),this._calcMatrices())}_setZoom(e){this._zoom=e,this.scale=this.zoomScale(e),this.tileZoom=Math.floor(e),this.zoomFraction=e-this.tileZoom}get tileCoverLift(){return this._tileCoverLift}set tileCoverLift(e){this._tileCoverLift!==e&&(this._tileCoverLift=e)}_updateCameraOnTerrain(){const e=this.elevation?this.elevation.getAtPoint(this.locationCoordinate(this.center),Number.NEGATIVE_INFINITY):Number.NEGATIVE_INFINITY,t=this.elevation&&e===Number.NEGATIVE_INFINITY&&this.elevation.visibleDemTiles.length>0&&this.elevation.exaggeration()>0&&this._centerAltitudeValidForExaggeration;if(!this._elevation||e===Number.NEGATIVE_INFINITY&&(!t||!this._centerAltitude))return this._centerAltitude=0,this._seaLevelZoom=null,void(this._centerAltitudeValidForExaggeration=void 0);const i=this._elevation;t||this._centerAltitude&&this._centerAltitudeValidForExaggeration&&i.exaggeration()&&this._centerAltitudeValidForExaggeration!==i.exaggeration()?(this._centerAltitude=this._centerAltitude/this._centerAltitudeValidForExaggeration*i.exaggeration(),this._centerAltitudeValidForExaggeration=i.exaggeration()):(this._centerAltitude=e||0,this._centerAltitudeValidForExaggeration=i.exaggeration()),this._updateSeaLevelZoom()}_updateSeaLevelZoom(){void 0!==this._centerAltitudeValidForExaggeration&&(this._seaLevelZoom=this._zoomFromMercatorZ((this.pixelsPerMeter*this._centerAltitude+this.cameraToCenterDistance)/this.worldSize))}sampleAverageElevation(){if(!this._elevation)return 0;const t=this._elevation,i=[[.5,.2],[.3,.5],[.5,.5],[.7,.5],[.5,.8]],r=this.horizonLineFromTop();let n=0,o=0;for(let s=0;s{const l=e.b2(i,t,r,o,s);a.has(l)||(n.push(new e.aQ(t,i,r,o,s)),a.add(l))};for(let e=0;e0,f=a.y+10,_=n.wrap-(p?0:1),g=n.wrap+(d?0:1),y=p?a.x-1:u-1,x=d?a.x+1:0;if(o)r[0]<0?(l(c,g,a.z,x,a.y),r[1]<0&&f&&(l(c,h,a.z,a.x,a.y+1),l(c,g,a.z,x,a.y+1)),r[1]>0&&m&&(l(c,h,a.z,a.x,a.y-1),l(c,g,a.z,x,a.y-1))):r[0]>0?(l(c,_,a.z,y,a.y),r[1]<0&&f&&(l(c,h,a.z,a.x,a.y+1),l(c,_,a.z,y,a.y+1)),r[1]>0&&m&&(l(c,h,a.z,a.x,a.y-1),l(c,_,a.z,y,a.y-1))):r[1]<0&&f?l(c,h,a.z,a.x,a.y+1):m&&l(c,h,a.z,a.x,a.y-1);else{const e=n.visibleQuadrants;1&e&&(l(c,_,a.z,y,a.y),m&&(l(c,h,a.z,a.x,a.y-1),l(c,_,a.z,y,a.y-1))),2&e&&(l(c,g,a.z,x,a.y),m&&(l(c,h,a.z,a.x,a.y-1),l(c,g,a.z,x,a.y-1))),4&e&&(l(c,_,a.z,y,a.y),f&&(l(c,h,a.z,a.x,a.y+1),l(c,_,a.z,y,a.y+1))),8&e&&(l(c,g,a.z,x,a.y),f&&(l(c,h,a.z,a.x,a.y+1),l(c,g,a.z,x,a.y+1)))}}const c=[];for(const e of n)n.some((t=>e.isChildOf(t)))||c.push(e);if(n=c.filter((e=>!t.some((t=>!!(e.overscaledZ{const t=e.canonical.x+.5-r[0],i=e.canonical.y+.5-r[1];return t*t+i*it.maxzoom&&(i=t.maxzoom);const a=this.locationCoordinate(this.center),l=this.center.lat,c=1<{const i=25e-6,r=new e._(t.x+i,t.y,t.z),n=new e._(t.x,t.y+i,t.z),o=t.toLngLat(),s=r.toLngLat(),a=n.toLngLat(),l=this.locationCoordinate(o),c=this.locationCoordinate(s),h=this.locationCoordinate(a),u=Math.hypot(c.x-l.x,c.y-l.y),d=Math.hypot(h.x-l.x,h.y-l.y);return Math.sqrt(u*d)*T/i},S=t=>{const i=b,r=w;return{aabb:e.aR(this,c,0,0,0,t,r,i,this.projection),zoom:0,x:0,y:0,minZ:r,maxZ:i,wrap:t,fullyVisible:!1}},M=[];let A=[];const I=i,C=t.reparseOverscaled?r:i,P=(_-this._centerAltitude)*m,z=e=>{if(!this._elevation||!e.tileID||!s)return;const t=this._elevation.getMinMaxForTile(e.tileID),i=e.aabb;t?(i.min[2]=t.min,i.max[2]=t.max,i.center[2]=(i.min[2]+i.max[2])/2):(e.shouldSplit=R(e),e.shouldSplit||(i.min[2]=i.max[2]=i.center[2]=this._centerAltitude))},D=(e,t)=>{if(.707*t{if(t.zoom=.9)return!0}else if(o&&(a=t.aabb.distanceZ(g)*m),this.projection.isReprojectedInTileSpace&&r<=5){const i=Math.pow(2,t.zoom),r=E(new e._((t.x+.5)/i,(t.y+.5)/i));c=r>.85?1:r}if(!s){const e=Math.sqrt(i*i+n*n+a*a);let r=(1<0;){const r=M.pop(),n=r.x,a=r.y;let l=r.fullyVisible;const d=()=>"globe"===this.projection.name&&(0===r.y||r.y===(1<>1),d={aabb:s?r.aabb.quadrant(t):e.aR(this,c,r.zoom+1,i,h,r.wrap,r.minZ,r.maxZ,this.projection),zoom:r.zoom+1,x:i,y:h,wrap:r.wrap,fullyVisible:l,tileID:void 0,shouldSplit:void 0,minZ:r.minZ,maxZ:r.maxZ};o&&!u&&(d.tileID=new e.aQ(r.zoom+1===I?C:r.zoom+1,r.wrap,r.zoom+1,i,h),z(d)),M.push(d)}else{const o=r.zoom===I?C:r.zoom;if(t.minzoom&&t.minzoom>o)continue;let s=0;if(!l){let i=y?r.aabb.intersectsPrecise(p):r.aabb.intersectsPreciseFlat(p);if(0===i&&d()){const t=new e.aO(r.zoom,n,a);i=e.aP(this,c,t,!0).intersectsPrecise(p)}if(0===i)continue;if(t.calculateQuadrantVisibility)if(p.containsPoint(r.aabb.center))s=15;else for(let e=0;e<4;e++)0!==r.aabb.quadrant(e).intersects(p)&&(s|=1<{const o=[0,0,0,1],s=[e.a4,e.a4,0,1],a=this.calculateFogTileMatrix(n.tileID.toUnwrapped());e.aB.transformMat4(o,o,a),e.aB.transformMat4(s,s,a);const l=e.aB.min([],o,s),c=e.aB.max([],o,s),h=e.aS(l,c);if(0===h)return!0;let u=!1;const d=this._elevation;if(d&&h>i&&0!==r){const i=this.calculateProjMatrix(n.tileID.toUnwrapped());let o;t.isTerrainDEM||(o=d.getMinMaxForTile(n.tileID)),o||(o={min:w,max:b});const s=e.b4(this.rotation),a=[s[0]*e.a4,s[1]*e.a4,o.max];e.$.transformMat4(a,a,i),u=(1-a[1])*this.height*.5e.distanceSq-t.distanceSq)).map((e=>e.tileID))}resize(e,t){this.width=e,this.height=t,this.pixelsToGLUnits=[2/e,-2/t],this._constrain(),this._calcMatrices()}get unmodified(){return this._unmodified}zoomScale(e){return Math.pow(2,e)}scaleZoom(e){return Math.log(e)/Math.LN2}project(t){const i=e.au(t.lat,-e.aT,e.aT),r=this.projection.project(t.lng,i);return new e.P(r.x*this.worldSize,r.y*this.worldSize)}unproject(e){return this.projection.unproject(e.x/this.worldSize,e.y/this.worldSize)}get point(){return this.project(this.center)}get pointMerc(){return this.point._div(this.worldSize)}get pixelsPerMeterRatio(){return this.pixelsPerMeter/e.ay(1,this.center.lat)/this.worldSize}setLocationAtPoint(t,i){let r,n;const o=this.centerPoint;if("globe"===this.projection.name){const e=this.worldSize;r=(i.x-o.x)/e,n=(i.y-o.y)/e}else{const e=this.pointCoordinate(i),t=this.pointCoordinate(o);r=e.x-t.x,n=e.y-t.y}const s=this.locationCoordinate(t);this.setLocation(new e._(s.x-r,s.y-n))}setLocation(e){this.center=this.coordinateLocation(e),this.projection.wrap&&(this.center=this.center.wrap())}locationPoint(e){return this.projection.locationPoint(this,e)}locationPoint3D(e){return this.projection.locationPoint(this,e,!0)}pointLocation(e){return this.coordinateLocation(this.pointCoordinate(e))}pointLocation3D(e){return this.coordinateLocation(this.pointCoordinate3D(e))}locationCoordinate(t,i){const r=i?e.ay(i,t.lat):void 0,n=this.projection.project(t.lng,t.lat);return new e._(n.x,n.y,r)}coordinateLocation(e){return this.projection.unproject(e.x,e.y)}pointRayIntersection(t,i){const r=null!=i?i:this._centerAltitude,n=[t.x,t.y,0,1],o=[t.x,t.y,1,1];e.aB.transformMat4(n,n,this.pixelMatrixInverse),e.aB.transformMat4(o,o,this.pixelMatrixInverse);const s=o[3];e.aB.scale(n,n,1/n[3]),e.aB.scale(o,o,1/s);const a=n[2],l=o[2];return{p0:n,p1:o,t:a===l?0:(r-a)/(l-a)}}screenPointToMercatorRay(t){const i=[t.x,t.y,0,1],r=[t.x,t.y,1,1];return e.aB.transformMat4(i,i,this.pixelMatrixInverse),e.aB.transformMat4(r,r,this.pixelMatrixInverse),e.aB.scale(i,i,1/i[3]),e.aB.scale(r,r,1/r[3]),i[2]=e.ay(i[2],this._center.lat)*this.worldSize,r[2]=e.ay(r[2],this._center.lat)*this.worldSize,e.aB.scale(i,i,1/this.worldSize),e.aB.scale(r,r,1/this.worldSize),new e.aU([i[0],i[1],i[2]],e.$.normalize([],e.$.sub([],r,i)))}rayIntersectionCoordinate(t){const{p0:i,p1:r,t:n}=t,o=e.ay(i[2],this._center.lat),s=e.ay(r[2],this._center.lat);return new e._(e.a3(i[0],r[0],n)/this.worldSize,e.a3(i[1],r[1],n)/this.worldSize,e.a3(o,s,n))}pointCoordinate(e,t=this._centerAltitude){return this.projection.pointCoordinate(this,e.x,e.y,t)}pointCoordinate3D(t){if(!this.elevation)return this.pointCoordinate(t);let i=this.projection.pointCoordinate3D(this,t.x,t.y);if(i)return new e._(i[0],i[1],i[2]);let r=0,n=this.horizonLineFromTop();if(t.y>n)return this.pointCoordinate(t);const o=.02*n,s=t.clone();for(let t=0;t<10&&n-r>o;t++){s.y=e.a3(r,n,.66);const t=this.projection.pointCoordinate3D(this,s.x,s.y);t?(n=s.y,i=t):r=s.y}return i?new e._(i[0],i[1],i[2]):this.pointCoordinate(t)}isPointAboveHorizon(e){return this.projection.isPointAboveHorizon(this,e)}isPointOnSurface(t){if(t.y<0||t.y>this.height||t.x<0||t.x>this.width)return!1;if(this.elevation||this.zoom>=e.aV)return!this.isPointAboveHorizon(t);const i=this.pointCoordinate(t);return i.y>=0&&i.y<=1}_coordinatePoint(t,i){const r=i&&this.elevation?this.elevation.getAtPointOrZero(t,this._centerAltitude):this._centerAltitude,n=[t.x*this.worldSize,t.y*this.worldSize,r+t.toAltitude(),1];return e.aB.transformMat4(n,n,this.pixelMatrix),n[3]>0?new e.P(n[0]/n[3],n[1]/n[3]):new e.P(Number.MAX_VALUE,Number.MAX_VALUE)}_getBoundsNonRectangular(){const{top:t,left:i}=this._edgeInsets,r=this.height-this._edgeInsets.bottom,n=this.width-this._edgeInsets.right,o=this.pointLocation3D(new e.P(i,t)),s=this.pointLocation3D(new e.P(n,t)),a=this.pointLocation3D(new e.P(n,r)),l=this.pointLocation3D(new e.P(i,r));let c=Math.min(o.lng,s.lng,a.lng,l.lng),h=Math.max(o.lng,s.lng,a.lng,l.lng),u=Math.min(o.lat,s.lat,a.lat,l.lat),d=Math.max(o.lat,s.lat,a.lat,l.lat);const p=Math.pow(2,-this.zoom)/16*270,f="globe"===this.projection.name?1:4,m=(t,i,r,n,o)=>{const s=(t+r)/2,a=(i+n)/2,l=new e.P(s,a),{lng:_,lat:g}=this.pointLocation3D(l),y=Math.max(0,c-_,u-g,_-h,g-d);c=Math.min(c,_),h=Math.max(h,_),u=Math.min(u,g),d=Math.max(d,g),(op)&&(m(t,i,s,a,o+1),m(s,a,r,n,o+1))};if(m(i,t,n,t,1),m(n,t,n,r,1),m(n,r,i,r,1),m(i,r,i,t,1),"globe"===this.projection.name){const[t,i]=e.aW(this);t?(d=90,h=180,c=-180):i&&(u=-90,h=180,c=-180)}return new e.aj(new e.aJ(c,u),new e.aJ(h,d))}_getBoundsRectangular(t,i){const{top:r,left:n}=this._edgeInsets,o=this.height-this._edgeInsets.bottom,s=this.width-this._edgeInsets.right,a=new e.P(n,r),l=new e.P(s,r),c=new e.P(s,o),h=new e.P(n,o);let u=this.pointCoordinate(a,t),d=this.pointCoordinate(l,t);const p=this.pointCoordinate(c,i),f=this.pointCoordinate(h,i),m=(e,t)=>(t.y-e.y)/(t.x-e.x);return u.y>1&&d.y>=0?u=new e._((1-f.y)/m(f,u)+f.x,1):u.y<0&&d.y<=1&&(u=new e._(-f.y/m(f,u)+f.x,0)),d.y>1&&u.y>=0?d=new e._((1-p.y)/m(p,d)+p.x,1):d.y<0&&u.y<=1&&(d=new e._(-p.y/m(p,d)+p.x,0)),(new e.aj).extend(this.coordinateLocation(u)).extend(this.coordinateLocation(d)).extend(this.coordinateLocation(f)).extend(this.coordinateLocation(p))}_getBoundsRectangularTerrain(){const e=this.elevation;if(!e.visibleDemTiles.length||e.isUsingMockSource())return this._getBoundsRectangular(0,0);const t=e.visibleDemTiles.reduce(((e,t)=>{if(t.dem){const i=t.dem.tree;e.min=Math.min(e.min,i.minimums[0]),e.max=Math.max(e.max,i.maximums[0])}return e}),{min:Number.MAX_VALUE,max:0});return this._getBoundsRectangular(t.min*e.exaggeration(),t.max*e.exaggeration())}getBounds(){return"mercator"===this.projection.name||"equirectangular"===this.projection.name?this._terrainEnabled()?this._getBoundsRectangularTerrain():this._getBoundsRectangular(0,0):this._getBoundsNonRectangular()}horizonLineFromTop(e=!0){const t=this.height/2/Math.tan(this._fov/2)/Math.tan(Math.max(this._pitch,.1))-this.centerOffset.y,i=this.height/2-t*(1-this._horizonShift);return e?Math.max(0,i):i}getMaxBounds(){return this.maxBounds}setMaxBounds(t){this.maxBounds=t,this.minLat=-e.aT,this.maxLat=e.aT,this.minLng=-180,this.maxLng=180,t&&(this.minLat=t.getSouth(),this.maxLat=t.getNorth(),this.minLng=t.getWest(),this.maxLng=t.getEast(),this.maxLngu&&(a=u-c),u-ht&&(s=t-l),t-e{for(let n=0;n<16;n++)e[n]=ui(t[n],i[n],r)})(a,a,l,di(this.pitch>=15?1:this.pitch/15))}else a=l;const c=e.ae.mul([],l,s);let h=e.ae.mul([],a,s);if(this.projection.isReprojectedInTileSpace){const t=this.locationCoordinate(this.center),i=e.ae.identity([]);e.ae.translate(i,i,[t.x*this.worldSize,t.y*this.worldSize,0]),e.ae.multiply(i,i,e.aZ(this)),e.ae.translate(i,i,[-t.x*this.worldSize,-t.y*this.worldSize,0]),e.ae.multiply(h,h,i),e.ae.multiply(c,c,i),this.inverseAdjustmentMatrix=e.a_(this)}else this.inverseAdjustmentMatrix=[1,0,0,1];if(this.mercatorMatrix=e.ae.scale([],h,[this.worldSize,this.worldSize,this.worldSize/o,1]),this.projMatrix=h,this.invProjMatrix=e.ae.invert(new Float64Array(16),this.projMatrix),i){const i=this._camera.getCameraToClipPerspective(this._fov,this.width/this.height,this._nearZ,1/0);i[8]=2*-t.x/this.width,i[9]=2*t.y/this.height,this.expandedFarZProjMatrix=e.ae.mul([],i,s)}else this.expandedFarZProjMatrix=this.projMatrix;const u=e.ae.invert([],a);this.frustumCorners=e.a$.fromInvProjectionMatrix(u,this.horizonLineFromTop(),this.height),this.cameraFrustum=e.aM.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,0,!i);const d=new Float32Array(16);e.ae.identity(d),e.ae.scale(d,d,[1,-1,1]),e.ae.rotateX(d,d,this._pitch),e.ae.rotateZ(d,d,this.angle);const p=e.ae.perspective(new Float32Array(16),this._fov,this.width/this.height,this._nearZ,this._farZ);this.starsProjMatrix=e.ae.clone(p);const f=(Math.PI/2-this._pitch)*(this.height/this._fov)*this._horizonShift;p[8]=2*-t.x/this.width,p[9]=2*(t.y+f)/this.height,this.skyboxMatrix=e.ae.multiply(d,p,d);const m=this.point,_=m.x,g=m.y,y=this.width%2/2,x=this.height%2/2,v=Math.cos(this.angle),b=Math.sin(this.angle),w=_-Math.round(_)+v*y+b*x,T=g-Math.round(g)+v*x+b*y,E=new Float64Array(h);if(e.ae.translate(E,E,[w>.5?w-1:w,T>.5?T-1:T,0]),this.alignedProjMatrix=E,h=e.ae.create(),e.ae.scale(h,h,[this.width/2,-this.height/2,1]),e.ae.translate(h,h,[1,-1,0]),this.labelPlaneMatrix=h,h=e.ae.create(),e.ae.scale(h,h,[1,-1,1]),e.ae.translate(h,h,[-1,-1,0]),e.ae.scale(h,h,[2/this.width,2/this.height,1]),this.glCoordMatrix=h,this.pixelMatrix=e.ae.multiply(new Float64Array(16),this.labelPlaneMatrix,c),this._calcFogMatrices(),this._distanceTileDataCache={},h=e.ae.invert(new Float64Array(16),this.pixelMatrix),!h)throw new Error("failed to invert matrix");if(this.pixelMatrixInverse=h,"globe"===this.projection.name||this.mercatorFromTransition){this.globeMatrix=e.b0(this);const t=[this.globeMatrix[12],this.globeMatrix[13],this.globeMatrix[14]];this.globeCenterInViewSpace=e.$.transformMat4(t,t,s),this.globeRadius=this.worldSize/2/Math.PI-1}else this.globeMatrix=h;this._projMatrixCache={},this._alignedProjMatrixCache={},this._pixelsToTileUnitsCache={},this._expandedProjMatrixCache={}}_calcFogMatrices(){this._fogTileMatrixCache={};const t=this.cameraWorldSizeForFog,i=this.cameraPixelsPerMeter,r=this._camera.position,n=1/this.height/this._pixelsPerMercatorPixel,o=[t,t,i];e.$.scale(o,o,n),e.$.scale(r,r,-1),e.$.multiply(r,r,o);const s=e.ae.create();e.ae.translate(s,s,r),e.ae.scale(s,s,o),this.mercatorFogMatrix=s,this.worldToFogMatrix=this._camera.getWorldToCameraPosition(t,i,n)}_computeCameraPosition(e){const t=(e=e||this.pixelsPerMeter)/this.pixelsPerMeter,i=this._camera.forward(),r=this.point,n=this._mercatorZfromZoom(this._seaLevelZoom?this._seaLevelZoom:this._zoom)*t-e/this.worldSize*this._centerAltitude;return[r.x/this.worldSize-i[0]*n,r.y/this.worldSize-i[1]*n,e/this.worldSize*this._centerAltitude-i[2]*n]}_updateCameraState(){this.height&&(this._camera.setPitchBearing(this._pitch,this.angle),this._camera.position=this._computeCameraPosition())}_translateCameraConstrained(t){const i=this._maxCameraBoundsDistance()*Math.cos(this._pitch),r=this._camera.position[2],n=t[2];let o=1;this.projection.wrap&&(this.center=this.center.wrap()),n>0&&(o=Math.min((i-r)/n,1)),this._camera.position=e.$.scaleAndAdd([],this._camera.position,t,o),this._updateStateFromCamera()}_updateStateFromCamera(){const t=this._camera.position,i=this._camera.forward(),{pitch:r,bearing:n}=this._camera.getPitchBearing(),o=e.ay(this._centerAltitude,this.center.lat)*this._pixelsPerMercatorPixel,s=this._mercatorZfromZoom(this._maxZoom)*Math.cos(e.ac(this._maxPitch)),a=Math.max((t[2]-o)/Math.cos(r),s),l=this._zoomFromMercatorZ(a);e.$.scaleAndAdd(t,t,i,a),this._pitch=e.au(r,e.ac(this.minPitch),e.ac(this.maxPitch)),this.angle=e.av(n,-Math.PI,Math.PI),this._setZoom(e.au(l,this._minZoom,this._maxZoom)),this._updateSeaLevelZoom(),this._center=this.coordinateLocation(new e._(t[0],t[1],t[2])),this._unmodified=!1,this._constrain(),this._calcMatrices()}_worldSizeFromZoom(e){return Math.pow(2,e)*this.tileSize}_mercatorZfromZoom(e){return this.cameraToCenterDistance/this._worldSizeFromZoom(e)}_minimumHeightOverTerrain(){const e=Math.min(null!=this._seaLevelZoom?this._seaLevelZoom:this._zoom,this._maxZoom)+4;return this._mercatorZfromZoom(e)}_zoomFromMercatorZ(e){return this.scaleZoom(this.cameraToCenterDistance/(e*this.tileSize))}zoomFromMercatorZAdjusted(t){let i=0,r=e.aV,n=0,o=1/0;for(;r-i>1e-6&&r>i;){const e=i+.5*(r-i),s=this.tileSize*Math.pow(2,e),a=this.getCameraToCenterDistance(this.projection,e,s),l=this.scaleZoom(a/(t*this.tileSize)),c=Math.abs(e-l);cc||i.y>1)return!0}return!1}isHorizonVisible(){return this.pitch+e.b1(this.fovAboveCenter)>88||this.anyCornerOffEdge(new e.P(0,0),new e.P(this.width,this.height))}zoomDeltaToMovement(t,i){const r=e.$.length(e.$.sub([],this._camera.position,t)),n=this._zoomFromMercatorZ(r)+i;return r-this._mercatorZfromZoom(n)}getCameraPoint(){if("globe"===this.projection.name){const t=(function([t,i,r],n){const o=[t,i,r,1];e.aB.transformMat4(o,o,n);const s=o[3]=Math.max(o[3],1e-6);return o[0]/=s,o[1]/=s,o[2]/=s,o})([this.globeMatrix[12],this.globeMatrix[13],this.globeMatrix[14]],this.pixelMatrix);return new e.P(t[0],t[1])}{const t=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new e.P(0,t))}}getCameraToCenterDistance(t,i=this.zoom,r=this.worldSize){const n=e.aY(t,i,this.width,this.height,1024),o=t.pixelSpaceConversion(this.center.lat,r,n);let s=.5/Math.tan(.5*this._fov)*this.height*o;return this.isOrthographic&&(s=ui(1,s,di(this.pitch>=15?1:this.pitch/15))),s}getWorldToCameraMatrix(){const t=this._camera.getWorldToCamera(this.worldSize,"meters"===this.projection.zAxisUnit?this.pixelsPerMeter:1);return"globe"===this.projection.name&&e.ae.multiply(t,t,this.globeMatrix),t}getFrustum(t){return e.aM.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,t,"meters"===this.projection.zAxisUnit)}}const fi={BaseColor:5,MetallicRoughness:6,Normal:7,Occlusion:8,Emission:9,LUT:10,ShadowMap0:11},mi=(t,i)=>{if(i>0&&t.terrain&&e.w("Cutoff is currently disabled on terrain"),i<=0||t.terrain)return{shouldRenderCutoff:!1,uniformValues:{u_cutoff_params:[0,0,0,1]}};const r=t.transform,n=Math.max(Math.abs(r._zoom-(t.minCutoffZoom-1)),1),o=r.isLODDisabled(!1)?e.a0(60,45,r.pitch):e.a0(30,15,r.pitch),s=r._farZ-r._nearZ,a=i*r.height,l=((1-(c=o))*r.cameraToCenterDistance+c*(r._farZ+a))*n;var c;return{shouldRenderCutoff:o<1,uniformValues:{u_cutoff_params:[r._nearZ,r._farZ,(l-r._nearZ)/s,(l-a-r._nearZ)/s]}}},_i={cascadeCount:2,normalOffset:3,shadowMapResolution:2048};class gi{constructor(e,t){this.aabb=e,this.lastCascade=t}}class yi{add(e,t){const i=this.receivers[e.key];void 0!==i?(i.aabb.min[0]=Math.min(i.aabb.min[0],t.min[0]),i.aabb.min[1]=Math.min(i.aabb.min[1],t.min[1]),i.aabb.min[2]=Math.min(i.aabb.min[2],t.min[2]),i.aabb.max[0]=Math.max(i.aabb.max[0],t.max[0]),i.aabb.max[1]=Math.max(i.aabb.max[1],t.max[1]),i.aabb.max[2]=Math.max(i.aabb.max[2],t.max[2])):this.receivers[e.key]=new gi(t,null)}clear(){this.receivers={}}get(e){return this.receivers[e.key]}computeRequiredCascades(t,i,r){const n=e.b8.fromPoints(t.points);let o=0;for(const t in this.receivers){const s=this.receivers[t];if(!s)continue;if(!n.intersectsAabb(s.aabb))continue;s.aabb.min=n.closestPoint(s.aabb.min),s.aabb.max=n.closestPoint(s.aabb.max);const a=s.aabb.getCorners();for(let t=0;t1||s[1]<-1||s[1]>1){n=!1;break}}if(s.lastCascade=t,o=Math.max(o,t),n)break}}return o+1}}class xi{constructor(t){this.painter=t,this._enabled=!1,this._shadowLayerCount=0,this._numCascadesToRender=0,this._cascades=[],this._groundShadowTiles=[],this._receivers=new yi,this._depthMode=new e.af(t.context.gl.LEQUAL,e.af.ReadWrite,[0,1]),this._uniformValues={u_light_matrix_0:new Float32Array(16),u_light_matrix_1:new Float32Array(16),u_shadow_intensity:0,u_fade_range:[0,0],u_shadow_normal_offset:[1,1,1],u_shadow_texel_size:1,u_shadow_map_resolution:1,u_shadow_direction:[0,0,1],u_shadow_bias:[36e-5,.0012,.012],u_shadowmap_0:0,u_shadowmap_1:0},this._forceDisable=!1,this.useNormalOffset=!1,t.tp.registerParameter(this,["Shadows"],"_forceDisable",{label:"forceDisable"},(()=>{this.painter.style.map.triggerRepaint()})),t.tp.registerParameter(_i,["Shadows"],"cascadeCount",{min:1,max:2,step:1}),t.tp.registerParameter(_i,["Shadows"],"normalOffset",{min:0,max:10,step:.05}),t.tp.registerParameter(_i,["Shadows"],"shadowMapResolution",{min:32,max:2048,step:32}),t.tp.registerBinding(this,["Shadows"],"_numCascadesToRender",{readonly:!0,label:"numCascadesToRender"})}destroy(){for(const e of this._cascades)e.texture.destroy(),e.framebuffer.destroy();this._cascades=[]}updateShadowParameters(t,i){const r=this.painter;if(this._enabled=!1,this._shadowLayerCount=0,this._receivers.clear(),!i||!i.properties)return;const n=i.properties.get("shadow-intensity");if(!i.shadowsEnabled()||n<=0)return;if(this._shadowLayerCount=r.style.order.reduce(((e,i)=>{const n=r.style._mergedLayers[i];return e+(n.hasShadowPass()&&!n.isHidden(t.zoom)?1:0)}),0),this._enabled=this._shadowLayerCount>0,!this.enabled)return;const o=r.context,s=_i.shadowMapResolution,a=_i.shadowMapResolution;if(0===this._cascades.length||_i.shadowMapResolution!==this._cascades[0].texture.size[0]){this._cascades=[];for(let t=0;t<_i.cascadeCount;++t){const t=r._shadowMapDebug,i=o.gl,n=o.createFramebuffer(s,a,t,"texture"),l=new e.T(o,{width:s,height:a,data:null},i.DEPTH_COMPONENT);if(n.depthAttachment.set(l.texture),t){const t=new e.T(o,{width:s,height:a,data:null},i.RGBA);n.colorAttachment.set(t.texture)}this._cascades.push({framebuffer:n,texture:l,matrix:[],far:0,boundingSphereRadius:0,frustum:new e.aM,scale:0})}}this.shadowDirection=bi(i);let l=0;if(t.elevation){const e=t.elevation,i=[1e4,-1e4];e.visibleDemTiles.filter((e=>e.dem)).forEach((e=>{const t=e.dem.tree;i[0]=Math.min(i[0],t.minimums[0]),i[1]=Math.max(i[1],t.maximums[0])})),1e4!==i[0]&&(l=(i[1]-i[0])*e.exaggeration())}const c=1.5*t.cameraToCenterDistance,h=3*c,u=new Float64Array(16);for(let i=0;i=0)return{};const o=(function(t,i,r){const n=r/(1<0&&(e.$.add(o[1],o[1],[n[0]*s,0,0]),e.$.add(o[2],o[2],[n[0]*s,0,0])),n[1]<0?(e.$.add(o[0],o[0],[0,n[1]*s,0]),e.$.add(o[1],o[1],[0,n[1]*s,0])):n[1]>0&&(e.$.add(o[2],o[2],[0,n[1]*s,0]),e.$.add(o[3],o[3],[0,n[1]*s,0]));const a={};return a.vertices=o,a.planes=[vi(o[1],o[0],o[4]),vi(o[2],o[1],o[5]),vi(o[3],o[2],o[6]),vi(o[0],o[3],o[7])],a}addShadowReceiver(t,i,r){this._receivers.add(t,e.b8.fromTileIdAndHeight(t,i,r))}getMaxCascadeForTile(e){const t=this._receivers.get(e);return t&&t.lastCascade?t.lastCascade:0}}function vi(t,i,r){const n=e.$.sub([],r,i),o=e.$.sub([],t,i),s=e.$.cross([],n,o),a=e.$.length(s);return 0===a?[0,0,1,0]:(e.$.scale(s,s,1/a),[s[0],s[1],s[2],-e.$.dot(s,i)])}function bi(t){const i=t.properties.get("direction"),r=e.ad(i.x,i.y,i.z);r[2]=e.au(r[2],0,75);const n=e.b9([r[0],r[1],r[2]]);return e.$.fromValues(n.x,n.y,n.z)}function wi(t,i,r){const n=i.properties.get("color"),o=i.properties.get("intensity"),s=i.properties.get("direction"),a=[s.x,s.y,s.z],l=r.properties.get("color"),c=r.properties.get("intensity"),h=Math.max(e.$.dot([0,0,1],a),0),u=[0,0,0];e.$.scale(u,l.toRenderColor(t.getLut(i.scope)).toArray01Linear().slice(0,3),c);const d=[0,0,0];return e.$.scale(d,n.toRenderColor(t.getLut(r.scope)).toArray01Linear().slice(0,3),h*o),e.ba([u[0]>0?u[0]/(u[0]+d[0]):0,u[1]>0?u[1]/(u[1]+d[1]):0,u[2]>0?u[2]/(u[2]+d[2]):0])}function Ti(t,i,r,n,o,s){const a=t.zoom,l=t.scale,c=t.worldSize,h=1/c,u=t.aspect,d=Math.sqrt(1+u*u)*Math.tan(.5*t.fovX),p=d*d,f=n-r,m=n+r;let _,g;p>f/m?(_=n,g=n*d):(_=.5*m*(1+p),g=.5*Math.sqrt(f*f+2*(n*n+r*r)*p+m*m*p*p));const y=t.projection.pixelsPerMeter(t.center.lat,c),x=t._camera.getCameraToWorldMercator(),v=[0,0,-_*h];e.$.transformMat4(v,v,x);let b=g*h;const w=t._edgeInsets;if(!(0===w.left&&0===w.top&&0===w.right&&0===w.bottom||w.left===w.right&&w.top===w.bottom)){const i=t._camera.getWorldToCamera(t.worldSize,"meters"===t.projection.zAxisUnit?y:1),o=t._camera.getCameraToClipPerspective(t._fov,t.width/t.height,r,n);o[8]=2*-t.centerOffset.x/t.width,o[9]=2*t.centerOffset.y/t.height;const s=new Float64Array(16);e.ae.mul(s,o,i);const h=new Float64Array(16);e.ae.invert(h,s);const u=e.aM.fromInvProjectionMatrix(h,c,a,!0);for(const i of u.points){const r=((T=i)[0]/=l,T[1]/=l,T[2]=e.ay(T[2],t._center.lat),T);b=Math.max(b,e.$.len(e.$.subtract([],v,r)))}}var T;b*=o/(o-1);const E=Math.acos(i[2]),S=Math.atan2(-i[0],-i[1]),M=new Wt;M.position=v,M.setPitchBearing(E,S);const A=M.getWorldToCamera(c,y),I=b*c,C=Math.min(t._mercatorZfromZoom(17)*c*-2,-2*I),P=M.getCameraToClipOrthographic(-I,I,-I,I,C,(I+s*y)/i[2]),z=new Float64Array(16);e.ae.multiply(z,P,A);const D=e.$.fromValues(Math.floor(1e6*v[0])/1e6*c,Math.floor(1e6*v[1])/1e6*c,0),R=.5*o,L=[0,0,0];e.$.transformMat4(L,D,z),e.$.scale(L,L,R);const k=[Math.floor(L[0]),Math.floor(L[1]),Math.floor(L[2])],O=[0,0,0];e.$.sub(O,L,k),e.$.scale(O,O,-1/R);const B=new Float64Array(16);return e.ae.identity(B),e.ae.translate(B,B,O),e.ae.multiply(z,B,z),[z,I]}function Ei(e,t){return null!=e&&null!=t&&!(!e.hasData()||!t.hasData())&&null!=e.demTexture&&null!=t.demTexture&&e.tileID.key!==t.tileID.key}const Si=new class{constructor(){this.operations={}}newMorphing(e,t,i,r,n){if(e in this.operations){const t=this.operations[e];t.to.tileID.key!==i.tileID.key&&(t.queued=i)}else this.operations[e]={startTime:r,phase:0,duration:n,from:t,to:i,queued:null}}getMorphValuesForProxy(e){if(!(e in this.operations))return null;const t=this.operations[e];return{from:t.from,to:t.to,phase:t.phase}}update(e){for(const t in this.operations){const i=this.operations[t];for(i.phase=(e-i.startTime)/i.duration;i.phase>=1||!this._validOp(i);)if(!this._nextOp(i,e)){delete this.operations[t];break}}}_nextOp(e,t){return!!e.queued&&(e.from=e.to,e.to=e.queued,e.queued=null,e.phase=0,e.startTime=t,!0)}_validOp(e){return e.from.hasData()&&e.to.hasData()}},Mi={0:null,1:"TERRAIN_VERTEX_MORPHING"};function Ai(e,t,i){if(0===t)return 0;const r=t<1&&514===i?.25/t:1;return 6*Math.pow(1.5,22-e)*Math.max(t,1)*r}function Ii(e,t){const i=1<({u_matrix:e});function Pi(t,i,r,n,o){if(o>0){const s=e.e.now(),a=(s-t.timeAdded)/o,l=i?(s-i.timeAdded)/o:-1,c=r.getSource(),h=n.coveringZoomLevel({tileSize:c.tileSize,roundZoom:c.roundZoom}),u=!i||Math.abs(i.tileID.overscaledZ-h)>Math.abs(t.tileID.overscaledZ-h),d=u&&t.refreshedUponExpiration?1:e.au(u?a:1-l,0,1);return t.refreshedUponExpiration&&a>=1&&(t.refreshedUponExpiration=!1),i?{opacity:1,mix:1-d}:{opacity:d,mix:0}}return{opacity:1,mix:0}}class zi extends Ft{constructor(t,i,r,n){super(t,i,r,n),this.type="raster-array",this.maxzoom=22,this._options=e.Q({type:"raster-array"},i)}triggerRepaint(e){const t=this.map.painter._terrain,i=this.map.style.getSourceCache(this.id);t&&t.enabled&&i&&t._clearRenderCacheForTile(i.id,e.tileID),this.map.triggerRepaint()}loadTile(t,i){const r=this.map._requestManager.normalizeTileURL(t.tileID.canonical.url(this.tiles,this.scheme),!1,this.tileSize),n=this.map._requestManager.transformRequest(r,e.R.Tile);t.requestParams=n,t.actor||(t.actor=this.dispatcher.getActor()),t.request=t.fetchHeader(void 0,((e,r,n,o)=>{if(delete t.request,t.aborted)return t.state="unloaded",i(null);if(e){if(20===e.code)return;return t.state="errored",i(e)}this.map._refreshExpiredTiles&&t.setExpiryData({cacheControl:n,expires:o}),t.state="empty",i(null)}))}unloadTile(t,i){const r=t.texture;r&&r instanceof e.T?(t.destroy(!0),this.map.painter.saveTileTexture(r)):(t.destroy(),t.flushQueues(),t._isHeaderLoaded=!1,delete t._mrt,delete t.textureDescriptor),t.fbo&&(t.fbo.destroy(),delete t.fbo),delete t.request,delete t.requestParams,delete t.neighboringTiles,t.state="unloaded"}prepareTile(t,i,r){t._isHeaderLoaded&&("empty"!==t.state&&(t.state="reloading"),t.fetchBand(i,r,((i,r)=>{if(i)return t.state="errored",this.fire(new e.f(i)),void this.triggerRepaint(t);r&&(t.setTexture(r,this.map.painter),t.state="loaded",this.triggerRepaint(t))})))}getInitialBand(e){if(!this.rasterLayers)return 0;const t=this.rasterLayers.find((({id:t})=>t===e)),i=t&&t.fields,r=i&&i.bands&&i.bands;return r?r[0]:0}getTextureDescriptor(t,i,r){if(!t)return;const n=i.sourceLayer||this.rasterLayerIds&&this.rasterLayerIds[0];if(!n)return;let o=null;i instanceof e.bm?o=i.paint.get("raster-array-band"):i instanceof e.bn&&(o=i.paint.get("raster-particle-array-band"));const s=o||this.getInitialBand(n);if(null!=s)if(t.textureDescriptor){if(!t.updateNeeded(n,s)||r)return Object.assign({},t.textureDescriptor,{texture:t.texture})}else this.prepareTile(t,n,s)}}const Di={vector:Nt,raster:Ft,"raster-dem":class extends Ft{constructor(t,i,r,n){super(t,i,r,n),this.type="raster-dem",this.maxzoom=22,this._options=e.Q({type:"raster-dem"},i),this.encoding=i.encoding||"mapbox"}loadTile(t,i){const r=this.map._requestManager.normalizeTileURL(t.tileID.canonical.url(this.tiles,this.scheme),!1,this.tileSize);function n(e,r){e&&(t.state="errored",i(e)),r&&(t.dem=r,t.dem.onDeserialize(),t.needsHillshadePrepare=!0,t.needsDEMTextureUpload=!0,t.state="loaded",i(null))}t.request=e.i(this.map._requestManager.transformRequest(r,e.R.Tile),function(r,o,s,a){if(delete t.request,t.aborted)t.state="unloaded",i(null);else if(r)t.state="errored",i(r);else if(o){this.map._refreshExpiredTiles&&t.setExpiryData({cacheControl:s,expires:a});const i=ImageBitmap&&o instanceof ImageBitmap&&e.bk(),r=1-(o.width-e.bl(o.width))/2;r<1||t.neighboringTiles||(t.neighboringTiles=this._getNeighboringTiles(t.tileID));const l=i?o:e.e.getImageData(o,r),c={uid:t.uid,coord:t.tileID,source:this.id,scope:this.scope,rawImageData:l,encoding:this.encoding,padding:r};t.actor&&"expired"!==t.state||(t.actor=this.dispatcher.getActor(),t.actor.send("loadDEMTile",c,n.bind(this),void 0,!0))}}.bind(this))}_getNeighboringTiles(t){const i=t.canonical,r=Math.pow(2,i.z),n=(i.x-1+r)%r,o=0===i.x?t.wrap-1:t.wrap,s=(i.x+1+r)%r,a=i.x+1===r?t.wrap+1:t.wrap,l={};return l[new e.aQ(t.overscaledZ,o,i.z,n,i.y).key]={backfilled:!1},l[new e.aQ(t.overscaledZ,a,i.z,s,i.y).key]={backfilled:!1},i.y>0&&(l[new e.aQ(t.overscaledZ,o,i.z,n,i.y-1).key]={backfilled:!1},l[new e.aQ(t.overscaledZ,t.wrap,i.z,i.x,i.y-1).key]={backfilled:!1},l[new e.aQ(t.overscaledZ,a,i.z,s,i.y-1).key]={backfilled:!1}),i.y+1{if(this._loaded=!0,this._pendingLoad=null,i)this.fire(new e.f(i));else{const i={dataType:"source",sourceDataType:this._metadataFired?"content":"metadata"};this._collectResourceTiming&&r&&r.resourceTiming&&r.resourceTiming[this.id]&&(i.resourceTiming=r.resourceTiming[this.id]),t&&(this._partialReload=!0),this.fire(new e.g("data",i)),this._partialReload=!1,this._metadataFired=!0}this._coalesce&&(this._updateWorkerData(t),this._coalesce=!1)}))}loaded(){return this._loaded}loadTile(t,i){const r=t.actor?"reloadTile":"loadTile";t.actor=this.actor;const n=this.map.style?this.map.style.getLut(this.scope):null,o=this._partialReload,s={type:this.type,uid:t.uid,tileID:t.tileID,tileZoom:t.tileZoom,zoom:t.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,lut:n?{image:n.image.clone()}:null,scope:this.scope,pixelRatio:e.e.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId,brightness:this.map.style&&this.map.style.getBrightness()||0,partial:o};t.request=this.actor.send(r,s,((e,n)=>o&&!n?(t.state="loaded",i(null)):(delete t.request,t.destroy(),t.aborted?i(null):e?i(e):(t.loadVectorData(n,this.map.painter,"reloadTile"===r),i(null)))),void 0,"loadTile"===r)}abortTile(e){e.request&&(e.request.cancel(),delete e.request),e.aborted=!0}unloadTile(e,t){this.actor.send("removeTile",{uid:e.uid,type:this.type,source:this.id,scope:this.scope}),e.destroy()}onRemove(e){this._pendingLoad&&this._pendingLoad.cancel()}serialize(){return e.Q({},this._options,{type:this.type,data:this._data})}hasTransition(){return!1}},video:class extends e.bo{constructor(e,t,i,r){super(e,t,i,r),this.roundZoom=!0,this.type="video",this.options=t}load(){this._loaded=!1;const t=this.options;this.urls=[];for(const i of t.urls)this.urls.push(this.map._requestManager.transformRequest(i,e.R.Source).url);e.bp(this.urls,((t,i)=>{this._loaded=!0,t?this.fire(new e.f(t)):i&&(this.video=i,this.video.loop=!0,this.video.setAttribute("playsinline",""),this.video.addEventListener("playing",(()=>{this.map.triggerRepaint()})),this.map&&this.video.play(),this._finishLoading())}))}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(t){if(this.video){const i=this.video.seekable;ti.end(0)?this.fire(new e.f(new e.V(`sources.${this.id}`,null,`Playback for this video can be set only between the ${i.start(0)} and ${i.end(0)}-second mark.`))):this.video.currentTime=t}}getVideo(){return this.video}onAdd(e){this.map||(this.map=e,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}prepare(){if(0===Object.keys(this.tiles).length||this.video.readyState<2)return;const t=this.map.painter.context,i=t.gl;this.texture?this.video.paused||(this.texture.bind(i.LINEAR,i.CLAMP_TO_EDGE),i.texSubImage2D(i.TEXTURE_2D,0,0,0,i.RGBA,i.UNSIGNED_BYTE,this.video)):(this.texture=new e.T(t,this.video,i.RGBA),this.texture.bind(i.LINEAR,i.CLAMP_TO_EDGE),this.width=this.video.videoWidth,this.height=this.video.videoHeight),this._prepareData(t)}serialize(){return{type:"video",urls:this.urls,coordinates:this.coordinates}}hasTransition(){return this.video&&!this.video.paused}},image:e.bo,model:class extends e.E{constructor(e,t,i,r){super(),this.id=e,this.type="model",this.models=[],this._loaded=!1,this._options=t}load(){const t=[];for(const i in this._options.models){const r=this._options.models[i],n=e.l(this.map._requestManager.transformRequest(r.uri,e.R.Model).url).then((t=>{if(!t)return;const n=e.c(t),o=new e.M(i,r.position,r.orientation,n);o.computeBoundsAndApplyParent(),this.models.push(o)})).catch((t=>{this.fire(new e.f(new Error(`Could not load model ${i} from ${r.uri}: ${t.message}`)))}));t.push(n)}return Promise.allSettled(t).then((()=>{this._loaded=!0,this.fire(new e.g("data",{dataType:"source",sourceDataType:"metadata"}))})).catch((t=>{this.fire(new e.f(new Error(`Could not load models: ${t.message}`)))}))}onAdd(e){this.map=e,this.load()}hasTransition(){return!1}loaded(){return this._loaded}getModels(){return this.models}loadTile(e,t){}serialize(){return{type:"model"}}},"batched-model":class extends e.E{constructor(e,t,i,r){super(),this.type="batched-model",this.id=e,this.tileSize=512,this._options=t,this.tiles=this._options.tiles,this.maxzoom=t.maxzoom||19,this.minzoom=t.minzoom||0,this.roundZoom=!0,this.usedInConflation=!0,this.dispatcher=i,this.reparseOverscaled=!1,this.scheme="xyz",this._loaded=!1,this.setEventedParent(r)}onAdd(e){this.map=e,this.load()}load(t){this._loaded=!1,this.fire(new e.g("dataloading",{dataType:"source"}));const i=Array.isArray(this.map._language)?this.map._language.join():this.map._language,r=this.map._worldview;this._tileJSONRequest=Ot(this._options,this.map._requestManager,i,r,((n,o)=>{this._tileJSONRequest=null,this._loaded=!0,n?(i&&console.warn(`Ensure that your requested language string is a valid BCP-47 code or list of codes. Found: ${i}`),r&&2!==r.length&&console.warn(`Requested worldview strings must be a valid ISO alpha-2 code. Found: ${r}`),this.fire(new e.f(n))):o&&(e.Q(this,o),o.bounds&&(this.tileBounds=new Bt(o.bounds,this.minzoom,this.maxzoom)),e.ao(o.tiles,this.map._requestManager._customAccessToken),this.fire(new e.g("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new e.g("data",{dataType:"source",sourceDataType:"content"}))),t&&t(n)}))}hasTransition(){return!1}hasTile(e){return!this.tileBounds||this.tileBounds.contains(e.canonical)}loaded(){return this._loaded}loadTile(t,i){const r=this.map._requestManager.normalizeTileURL(t.tileID.canonical.url(this.tiles,this.scheme)),n={request:this.map._requestManager.transformRequest(r,e.R.Tile),data:void 0,uid:t.uid,tileID:t.tileID,tileZoom:t.tileZoom,zoom:t.tileID.overscaledZ,tileSize:this.tileSize*t.tileID.overscaleFactor(),type:this.type,source:this.id,scope:this.scope,showCollisionBoxes:this.map.showCollisionBoxes,isSymbolTile:t.isSymbolTile,brightness:this.map.style&&this.map.style.getBrightness()||0};if(t.actor&&"expired"!==t.state)if("loading"===t.state)t.reloadCallback=i;else{if(t.buckets){const e=Object.values(t.buckets);for(const t of e)t.dirty=!0;return void(t.state="loaded")}t.request=t.actor.send("reloadTile",n,o.bind(this))}else t.actor=this.dispatcher.getActor(),t.request=t.actor.send("loadTile",n,o.bind(this),void 0,!0);function o(e,r){return t.aborted?i(null):e&&404!==e.status?i(e):(r&&(r.resourceTiming&&(t.resourceTiming=r.resourceTiming),this.map._refreshExpiredTiles&&t.setExpiryData(r),t.buckets=Object.assign({},t.buckets,r.buckets),r.featureIndex&&(t.latestFeatureIndex=r.featureIndex)),t.state="loaded",void i(null))}}serialize(){return e.Q({},this._options)}},canvas:class extends e.bo{constructor(t,i,r,n){super(t,i,r,n),i.coordinates?Array.isArray(i.coordinates)&&4===i.coordinates.length&&!i.coordinates.some((e=>!Array.isArray(e)||2!==e.length||e.some((e=>"number"!=typeof e))))||this.fire(new e.f(new e.V(`sources.${t}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new e.f(new e.V(`sources.${t}`,null,'missing required property "coordinates"'))),i.animate&&"boolean"!=typeof i.animate&&this.fire(new e.f(new e.V(`sources.${t}`,null,'optional "animate" property must be a boolean value'))),i.canvas?"string"==typeof i.canvas||i.canvas instanceof HTMLCanvasElement||this.fire(new e.f(new e.V(`sources.${t}`,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new e.f(new e.V(`sources.${t}`,null,'missing required property "canvas"'))),this.options=i,this.animate=void 0===i.animate||i.animate}load(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof HTMLCanvasElement?this.options.canvas:document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new e.f(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(e){this.pause()}prepare(){let t=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,t=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,t=!0),this._hasInvalidDimensions())return;if(0===Object.keys(this.tiles).length)return;const i=this.map.painter.context;this.texture?!t&&!this._playing||this.texture instanceof e.bq||this.texture.update(this.canvas,{premultiply:!0}):this.texture=new e.T(i,this.canvas,i.gl.RGBA,{premultiply:!0}),this._prepareData(i)}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}},custom:class extends e.E{constructor(t,i,r,n){super(),this.id=t,this.type="custom",this._dataType="raster",this._dispatcher=r,this._implementation=i,this.setEventedParent(n),this.scheme="xyz",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this._loaded=!1,this.roundZoom=!0,this._implementation||this.fire(new e.f(new Error(`Missing implementation for ${this.id} custom source`))),this._implementation.loadTile||this.fire(new e.f(new Error(`Missing loadTile implementation for ${this.id} custom source`))),this._implementation.bounds&&(this.tileBounds=new Bt(this._implementation.bounds,this.minzoom,this.maxzoom)),i.update=this._update.bind(this),i.clearTiles=this._clearTiles.bind(this),i.coveringTiles=this._coveringTiles.bind(this),e.Q(this,e.ai(i,["dataType","scheme","minzoom","maxzoom","tileSize","attribution","minTileCacheSize","maxTileCacheSize"]))}serialize(){return e.ai(this,["type","scheme","minzoom","maxzoom","tileSize","attribution"])}load(){this._loaded=!0,this.fire(new e.g("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new e.g("data",{dataType:"source",sourceDataType:"content"}))}loaded(){return this._loaded}onAdd(t){this.map=t,this._loaded=!1,this.fire(new e.g("dataloading",{dataType:"source"})),this._implementation.onAdd&&this._implementation.onAdd(t),this.load()}onRemove(e){this._implementation.onRemove&&this._implementation.onRemove(e)}hasTile(e){if(this._implementation.hasTile){const{x:t,y:i,z:r}=e.canonical;return this._implementation.hasTile({x:t,y:i,z:r})}return!this.tileBounds||this.tileBounds.contains(e.canonical)}loadTile(e,t){const{x:i,y:r,z:n}=e.tileID.canonical,o=new AbortController;e.request=Promise.resolve(this._implementation.loadTile({x:i,y:r,z:n},{signal:o.signal})).then(function(i){return delete e.request,e.aborted?(e.state="unloaded",t(null)):void 0===i?(e.state="errored",t(null)):null===i?(this.loadTileData(e,{width:this.tileSize,height:this.tileSize,data:null}),e.state="loaded",t(null)):(function(e){return e instanceof ImageData||e instanceof HTMLCanvasElement||e instanceof ImageBitmap||e instanceof HTMLImageElement})(i)?(this.loadTileData(e,i),e.state="loaded",void t(null)):(e.state="errored",t(new Error(`Can't infer data type for ${this.id}, only raster data supported at the moment`)))}.bind(this)).catch((i=>{20!==i.code&&(e.state="errored",t(i))})),e.request.cancel=()=>o.abort()}loadTileData(e,t){e.setTexture(t,this.map.painter)}unloadTile(t,i){if(t.texture&&t.texture instanceof e.T?(t.destroy(!0),t.texture&&t.texture instanceof e.T&&this.map.painter.saveTileTexture(t.texture)):t.destroy(),this._implementation.unloadTile){const{x:e,y:i,z:r}=t.tileID.canonical;this._implementation.unloadTile({x:e,y:i,z:r})}i&&i()}abortTile(e,t){e.request&&e.request.cancel&&(e.request.cancel(),delete e.request),t&&t()}hasTransition(){return!1}_coveringTiles(){return this.map.transform.coveringTiles({tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,roundZoom:this.roundZoom}).map((e=>({x:e.canonical.x,y:e.canonical.y,z:e.canonical.z})))}_clearTiles(){const t=e.am(this.id,this.scope);this.map.style.clearSource(t)}_update(){this.fire(new e.g("data",{dataType:"source",sourceDataType:"content"}))}}},Ri=function(t,i,r,n){const o=new Di[i.type](t,i,r,n);if(o.id!==t)throw new Error(`Expected Source id to be ${t} instead of ${o.id}`);return e.br(["load","abort","unload","serialize","prepare"],o),o};class Li extends e.bx{constructor(t){const i={type:"raster-dem",maxzoom:t.transform.maxZoom},r=new e.by(e.bz(),null),n=Ri("mock-dem",i,r,t.style);super("mock-dem",n,!1),n.setEventedParent(this),this._sourceLoaded=!0}_loadTile(e,t){e.state="loaded",t(null)}}class ki extends e.bx{constructor(t){const i=Ri("proxy",{type:"geojson",maxzoom:t.transform.maxZoom},new e.by(e.bz(),null),t.style);super("proxy",i,!1),i.setEventedParent(this),this.map=this.getSource().map=t,this.used=this._sourceLoaded=!0,this.renderCache=[],this.renderCachePool=[],this.proxyCachedFBO={}}update(t,i,r){if(t.freezeTileCoverage)return;this.transform=t;const n=t.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}).reduce(((i,r)=>{if(i[r.key]="",!this._tiles[r.key]){const i=new e.bA(r,this._source.tileSize*r.overscaleFactor(),t.tileZoom);i.state="loaded",this._tiles[r.key]=i}return i}),{});for(const e in this._tiles)e in n||(this.freeFBO(e),this._tiles[e].unloadVectorData(),delete this._tiles[e])}freeFBO(e){const t=this.proxyCachedFBO[e];if(void 0!==t){const i=Object.values(t);this.renderCachePool.push(...i),delete this.proxyCachedFBO[e]}}deallocRenderCache(){this.renderCache.forEach((e=>e.fb.destroy())),this.renderCache=[],this.renderCachePool=[],this.proxyCachedFBO={}}}class Oi extends e.aQ{constructor(e,t,i){super(e.overscaledZ,e.wrap,e.canonical.z,e.canonical.x,e.canonical.y),this.proxyTileKey=t,this.projMatrix=i}}class Bi extends e.bs{constructor(t,i){super(),this._debugParams={sortTilesHiZFirst:!0,disableRenderCache:!1},t.tp.registerParameter(this._debugParams,["Terrain"],"sortTilesHiZFirst",{},(()=>{this._style.map.triggerRepaint()})),t.tp.registerParameter(this._debugParams,["Terrain"],"disableRenderCache",{},(()=>{this._style.map.triggerRepaint()})),t.tp.registerButton(["Terrain"],"Invalidate Render Cache",(()=>{this.invalidateRenderCache=!0,this._style.map.triggerRepaint()})),this.painter=t,this.terrainTileForTile={},this.prevTerrainTileForTile={};const[r,n,o]=(function(){const t=new e.bv,i=new e.bw,r=131;t.reserve(17161),i.reserve(33800);const n=e.a4/128,o=e.a4+n/2,s=o+n;for(let i=-n;io||i<0||i>o?24575:0,s=e.au(Math.round(r),0,e.a4),a=e.au(Math.round(i),0,e.a4);t.emplaceBack(s+n,a)}const a=(e,t)=>{const n=t*r+e;i.emplaceBack(n+1,n,n+r),i.emplaceBack(n+r,n+r+1,n+1)};for(let e=1;e<129;e++)for(let t=1;t<129;t++)a(t,e);return[0,129].forEach((e=>{for(let t=0;t<130;t++)a(t,e),a(e,t)})),[t,i,32768]})(),s=t.context;this.gridBuffer=s.createVertexBuffer(r,e.bt.members),this.gridIndexBuffer=s.createIndexBuffer(n),this.gridSegments=e.b.simpleSegment(0,0,r.length,n.length),this.gridNoSkirtSegments=e.b.simpleSegment(0,0,r.length,o),this.proxyCoords=[],this.proxiedCoords={},this._visibleDemTiles=[],this._drapedRenderBatches=[],this._sourceTilesOverlap={},this.proxySourceCache=new ki(i.map),this.orthoMatrix=e.ae.create(),e.ae.ortho(this.orthoMatrix,"globe"===this.painter.transform.projection.name?.015:0,e.a4,0,e.a4,0,1);const a=s.gl;this._overlapStencilMode=new e.ah({func:a.GEQUAL,mask:255},0,255,a.KEEP,a.KEEP,a.REPLACE),this._previousZoom=t.transform.zoom,this.pool=[],this._findCoveringTileCache={},this._tilesDirty={},this.style=i,this._useVertexMorphing=!0,this._exaggeration=1,this._mockSourceCache=new Li(i.map),this._pendingGroundEffectLayers=[]}set style(e){e.on("data",this._onStyleDataEvent.bind(this)),this._style=e,this._style.map.on("moveend",(()=>{this._clearLineLayersFromRenderCache()}))}update(t,i,r){if(t&&t.terrain){this._style!==t&&(this.style=t,this._evaluationZoom=void 0);const n=t.terrain.properties,o=0===t.terrain.drapeRenderMode,s=t.terrain.isZoomDependent();this._previousUpdateTimestamp=this.enabled?this._updateTimestamp:void 0,this._updateTimestamp=e.e.now();const a=t.terrain&&t.terrain.scope,l=n.get("source"),c=o?this._mockSourceCache:t.getSourceCache(l,a);if(!c)return void e.w(`Couldn't find terrain source "${l}".`);if(this.sourceCache=c,this._exaggeration=s?this.calculateExaggeration(i):n.get("exaggeration"),!i.projection.requiresDraping&&s&&0===this._exaggeration)return void this._disable();this.enabled=!0;const h=()=>{this.sourceCache.used&&e.w(`Raster DEM source '${this.sourceCache.id}' is used both for terrain and as layer source.\nThis leads to lower resolution of hillshade. For full hillshade resolution but higher memory consumption, define another raster DEM source.`);const t=this.getScaledDemTileSize();this.sourceCache.update(i,t,!0),this.resetTileLookupCache(this.sourceCache.id)};this.sourceCache.usedForTerrain||(this.resetTileLookupCache(this.sourceCache.id),this.sourceCache.usedForTerrain=!0,h(),this._initializing=!0),h(),i.updateElevation(!0,r),this.resetTileLookupCache(this.proxySourceCache.id),this.proxySourceCache.update(i),this._emptyDEMTextureDirty=!0,this._previousZoom=i.zoom}else this._disable()}calculateExaggeration(t){const i=this._previousCameraAltitude,r=t.getFreeCameraOptions().position.z/t.pixelsPerMeter*t.worldSize;this._previousCameraAltitude=r;const n=null!=i?r-i:Number.MAX_VALUE;if(Math.abs(n)<2)return this._exaggeration;const o=t.zoom,s=this._style.terrain;if(!this._previousUpdateTimestamp)return s.getExaggeration(o);let a=o-this._previousZoom;const l=this._previousUpdateTimestamp;let c=o;null!=this._evaluationZoom&&(c=this._evaluationZoom,Math.abs(o-c)>.5&&(a=.5*(o-c+a)),a*n<0&&(c+=a)),this._evaluationZoom=c;const h=s.getExaggeration(c),u=h===s.getExaggeration(Math.max(0,c-.1));if(u&&Math.abs(h-this._exaggeration)<.01)return h;let d=Math.min(.1,.00375*(this._updateTimestamp-l));return(u||h<.1||Math.abs(a)<1e-4)&&(d=Math.min(.2,4*d)),e.a3(this._exaggeration,h,d)}resetTileLookupCache(e){this._findCoveringTileCache[e]={}}getScaledDemTileSize(){return this.sourceCache.getSource().tileSize/128*this.proxySourceCache.getSource().tileSize}_onStyleDataEvent(e){e.coord&&"source"===e.dataType?this._clearRenderCacheForTile(e.sourceCacheId,e.coord):"style"===e.dataType&&(this.invalidateRenderCache=!0,this._evaluationZoom=void 0,this._previousUpdateTimestamp=void 0,this._previousCameraAltitude=void 0)}_disable(){if(this.enabled&&(this.enabled=!1,this._emptyDEMTextureDirty=!0,this._sharedDepthStencil=void 0,this._evaluationZoom=void 0,this._previousUpdateTimestamp=void 0,this.proxySourceCache.deallocRenderCache(),this._style))for(const e in this._style._mergedSourceCaches)this._style._mergedSourceCaches[e].usedForTerrain=!1}destroy(){this._disable(),this._emptyDEMTexture&&this._emptyDEMTexture.destroy(),this.pool.forEach((e=>e.fb.destroy())),this.pool=[],this.framebufferCopyTexture&&this.framebufferCopyTexture.destroy()}_source(){return this.enabled?this.sourceCache:null}isUsingMockSource(){return this.sourceCache===this._mockSourceCache}exaggeration(){return this.enabled?this._exaggeration:0}get visibleDemTiles(){return this._visibleDemTiles}get drapeBufferSize(){const e=2*this.proxySourceCache.getSource().tileSize;return[e,e]}set useVertexMorphing(e){this._useVertexMorphing=e}updateTileBinding(t){if(!this.enabled)return;this.prevTerrainTileForTile=this.terrainTileForTile;const i=this.proxySourceCache,r=this.painter.transform;this._initializing&&(this._initializing=0===r._centerAltitude&&-1===this.getAtPointOrZero(e._.fromLngLat(r.center),-1),this._emptyDEMTextureDirty=!this._initializing);const n=this.proxyCoords=i.getIds().map((e=>{const t=i.getTileByID(e).tileID;return t.projMatrix=r.calculateProjMatrix(t.toUnwrapped()),t}));!(function(t,i){const r=i.transform.pointCoordinate(i.transform.getCameraPoint()),n=new e.P(r.x,r.y);t.sort(((t,i)=>{if(i.overscaledZ-t.overscaledZ)return i.overscaledZ-t.overscaledZ;const r=new e.P(t.canonical.x+(1<{this.proxyToSource[e.key]={}})),this.terrainTileForTile={};const s=this._style._mergedSourceCaches;for(const e in s){const i=s[e];if(!i.used)continue;if(i!==this.sourceCache&&this.resetTileLookupCache(i.id),this._setupProxiedCoordsForOrtho(i,t[e],o),i.usedForTerrain)continue;const r=t[e];i.getSource().reparseOverscaled&&this._assignTerrainTiles(r)}this.proxiedCoords[i.id]=n.map((e=>new Oi(e,e.key,this.orthoMatrix))),this._assignTerrainTiles(n),this._prepareDEMTextures(),this._setupDrapedRenderBatches(),this._initFBOPool(),this._setupRenderCache(o),this.renderingToTexture=!1;const a={};this._visibleDemTiles=[];for(const e of this.proxyCoords){const t=this.terrainTileForTile[e.key];if(!t)continue;const i=t.tileID.key;i in a||(this._visibleDemTiles.push(t),a[i]=i)}}_assignTerrainTiles(e){this._initializing||e.forEach((e=>{if(this.terrainTileForTile[e.key])return;const t=this._findTileCoveringTileID(e,this.sourceCache);t&&(this.terrainTileForTile[e.key]=t)}))}_prepareDEMTextures(){const e=this.painter.context,t=e.gl;for(const i in this.terrainTileForTile){const r=this.terrainTileForTile[i],n=r.dem;!n||r.demTexture&&!r.needsDEMTextureUpload||(e.activeTexture.set(t.TEXTURE1),Lt(this.painter,r,n))}}_prepareDemTileUniforms(e,t,i,r){if(!t||null==t.demTexture)return!1;const n=e.tileID.canonical,o=Math.pow(2,t.tileID.canonical.z-n.z),s=r||"";return i[`u_dem_tl${s}`]=[n.x*o%1,n.y*o%1],i[`u_dem_scale${s}`]=o,!0}get emptyDEMTexture(){return!this._emptyDEMTextureDirty&&this._emptyDEMTexture?this._emptyDEMTexture:this._updateEmptyDEMTexture()}_getLoadedAreaMinimum(){if(!this.enabled)return 0;let e=0;const t=this._visibleDemTiles.reduce(((t,i)=>{if(!i.dem)return t;const r=i.dem.tree.minimums[0];return r>0&&e++,t+r}),0);return e?t/e:0}_updateEmptyDEMTexture(){const t=this.painter.context,i=t.gl;t.activeTexture.set(i.TEXTURE2);const r=this._getLoadedAreaMinimum(),[n,o]=(()=>{const t=new e.bB({width:1,height:1},new Float32Array([r]));return[i.R32F,t]})();this._emptyDEMTextureDirty=!1;let s=this._emptyDEMTexture;return s?s.update(o,{premultiply:!1}):s=this._emptyDEMTexture=new e.T(t,o,n,{premultiply:!1}),s}setupElevationDraw(t,i,r){const n=this.painter.context,o=n.gl,s={u_dem:2,u_dem_prev:4,u_dem_tl:[0,0],u_dem_tl_prev:[0,0],u_dem_scale:0,u_dem_scale_prev:0,u_dem_size:0,u_dem_lerp:1,u_depth:3,u_depth_size_inv:[0,0],u_depth_range_unpack:[0,1],u_occluder_half_size:16,u_occlusion_depth_offset:-1e-4,u_exaggeration:0};s.u_exaggeration=this.exaggeration();let a=null,l=null,c=1;if(r&&r.morphing&&this._useVertexMorphing){const e=r.morphing.srcDemTile,i=r.morphing.dstDemTile;c=r.morphing.phase,e&&i&&(this._prepareDemTileUniforms(t,e,s,"_prev")&&(l=e),this._prepareDemTileUniforms(t,i,s)&&(a=i))}const h=e=>e&&e.demTexture&&this.painter.linearFloatFilteringSupported()?o.LINEAR:o.NEAREST;let u=null;var d;if(this.enabled?l&&a?(u=a.demTexture,n.activeTexture.set(o.TEXTURE4),l.demTexture.bind(h(l),o.CLAMP_TO_EDGE),s.u_dem_lerp=c):(a=this.terrainTileForTile[t.tileID.key],u=this._prepareDemTileUniforms(t,a,s)?a.demTexture:this.emptyDEMTexture):u=this.emptyDEMTexture,n.activeTexture.set(o.TEXTURE2),u&&(s.u_dem_size=1===(d=u).size[0]?1:d.size[0]-2,u.bind(h(a),o.CLAMP_TO_EDGE)),this.painter.setupDepthForOcclusion(r&&r.useDepthForOcclusion,i,s),r&&r.useMeterToDem&&a){const t=(1<{if(c===i)return;const r=[Mi[i],"PROJECTION_GLOBE_VIEW"];u&&r.push("CUSTOM_ANTIALIASING");const n=t.isTileAffectedByFog(e);l=t.getOrCreateProgram("globeRaster",{defines:r,overrideFog:n}),c=i},p=t.colorModeForRenderPass(),f=new e.af(a.LEQUAL,e.af.ReadWrite,t.depthRangeFor3D);Si.update(o);const m=e.bd(h),_=[e.ak(h.center.lng),e.al(h.center.lat)],g=t.globeSharedBuffers,y=[h.width*e.e.devicePixelRatio,h.height*e.e.devicePixelRatio],x=Float32Array.from(h.globeMatrix),v={useDenormalizedUpVectorScale:!0};{const h=t.transform,u=Ai(h.zoom,i.exaggeration(),i.sourceCache._source.tileSize);c=-1;const b=a.TRIANGLES;for(const c of n){const n=r.getTile(c),w=e.ah.disabled,T=i.prevTerrainTileForTile[c.key],E=i.terrainTileForTile[c.key];Ei(T,E)&&Si.newMorphing(c.key,T,E,o,250),s.activeTexture.set(a.TEXTURE0),n.texture&&n.texture.bind(a.LINEAR,a.CLAMP_TO_EDGE);const S=Si.getMorphValuesForProxy(c.key),M=S?1:0;S&&e.q(v,{morphing:{srcDemTile:S.from,dstDemTile:S.to,phase:e.bb(S.phase)}});const A=e.be(c.canonical),I=e.bf(A.getCenter().lat),C=e.bg(c.canonical,A,I,h.worldSize/h._pixelsPerMercatorPixel),P=e.bh(e.bi(c.canonical)),z=Ut(h.expandedFarZProjMatrix,x,m,P,e.a2(h.zoom),_,h.frustumCorners.TL,h.frustumCorners.TR,h.frustumCorners.BR,h.frustumCorners.BL,h.globeCenterInViewSpace,h.globeRadius,y,u,h._farZ,C);if(d(c,M),l&&(i.setupElevationDraw(n,l,v),t.uploadCommonUniforms(s,l,c.toUnwrapped()),g)){const[i,r,n]=g.getGridBuffers(I,0!==u);l.draw(t,b,f,w,p,e.ag.backCCW,z,"globe_raster",i,r,n)}}}if(g&&(t.renderDefaultNorthPole||t.renderDefaultSouthPole)){const o=["GLOBE_POLES","PROJECTION_GLOBE_VIEW"];u&&o.push("CUSTOM_ANTIALIASING"),l=t.getOrCreateProgram("globeRaster",{defines:o});for(const o of n){const{x:n,y:c,z:u}=o.canonical,d=0===c,m=c===(1<i.draw(t,a.TRIANGLES,f,e.ah.disabled,p,e.ag.disabled,Ut(h.expandedFarZProjMatrix,g,g,E,0,_,h.frustumCorners.TL,h.frustumCorners.TR,h.frustumCorners.BR,h.frustumCorners.BL,h.globeCenterInViewSpace,h.globeRadius,y,0,h._farZ),"globe_pole_raster",r,w,T);i.setupElevationDraw(c,l,v),t.uploadCommonUniforms(s,l,o.toUnwrapped()),d&&t.renderDefaultNorthPole&&S(l,x),m&&t.renderDefaultSouthPole&&(g=e.ae.scale(e.ae.create(),g,[1,-1,1]),S(l,b))}}}})(t,i,r,n,o);else{const s=t.context,a=s.gl;let l,c;const h=t.shadowRenderer,u=mi(t,t.longestCutoffRange),d=e=>{if(c===e)return;const i=[];i.push(Mi[e]),u.shouldRenderCutoff&&i.push("RENDER_CUTOFF"),l=t.getOrCreateProgram("terrainRaster",{defines:i}),c=e},p=t.colorModeForRenderPass(),f=new e.af(a.LEQUAL,e.af.ReadWrite,t.depthRangeFor3D);Si.update(o);const m=t.transform,_=Ai(m.zoom,i.exaggeration(),i.sourceCache._source.tileSize);let g=[0,0,0];if(h){const e=t.style.directionalLight,i=t.style.ambientLight;e&&i&&(g=wi(t.style,e,i))}{c=-1;const y=a.TRIANGLES,[x,v]=[i.gridIndexBuffer,i.gridSegments];for(const c of n){const n=r.getTile(c),b=e.ah.disabled,w=i.prevTerrainTileForTile[c.key],T=i.terrainTileForTile[c.key];Ei(w,T)&&Si.newMorphing(c.key,w,T,o,250),s.activeTexture.set(a.TEXTURE0),n.texture&&n.texture.bind(a.LINEAR,a.CLAMP_TO_EDGE);const E=Si.getMorphValuesForProxy(c.key),S=E?1:0;let M;E&&(M={morphing:{srcDemTile:E.from,dstDemTile:E.to,phase:e.bb(E.phase)}});const A=Vt(c.projMatrix,Ii(c.canonical,m.renderWorldCopies)?_/10:_,g);if(d(S),!l)continue;i.setupElevationDraw(n,l,M);const I=c.toUnwrapped();h&&h.setupShadows(I,l),t.uploadCommonUniforms(s,l,I,null,u),l.draw(t,y,f,b,p,e.ag.backCCW,A,"terrain_raster",i.gridBuffer,x,v)}}}})(i,this,this.proxySourceCache,t,this._updateTimestamp),this.renderingToTexture=!0,i.gpuTimingDeferredRenderEnd(),t.splice(0,t.length))}renderBatch(t){if(0===this._drapedRenderBatches.length)return t+1;this.renderingToTexture=!0;const i=this.painter,r=this.painter.context,n=this.proxySourceCache,o=this.proxiedCoords[n.id],s=this._drapedRenderBatches.shift(),a=i.style.order,l=[];let c=0;for(const h of o){const o=n.getTileByID(h.proxyTileKey),u=n.proxyCachedFBO[h.key]?n.proxyCachedFBO[h.key][t]:void 0,d=void 0!==u?n.renderCache[u]:this.pool[c++],p=void 0!==u;if(o.texture=d.tex,p&&!d.dirty){l.push(o.tileID);continue}let f;r.bindFramebuffer.set(d.fb.framebuffer),this.renderedToTile=!1,d.dirty&&(r.clear({color:e.C.transparent,stencil:0}),d.dirty=!1);for(let e=s.start;e<=s.end;++e){const t=i.style._mergedLayers[a[e]];if(t.isHidden(i.transform.zoom))continue;const n=i.style.getLayerSourceCache(t),o=n?this.proxyToSource[h.key][n.id]:[h];if(!o)continue;const s=o;r.viewport.set([0,0,d.fb.width,d.fb.height]),f!==(n?n.id:null)&&(this._setupStencil(d,o,t,n),f=n?n.id:null),i.renderLayer(i,n,t,s)}if(0===this._drapedRenderBatches.length)for(const e of this._pendingGroundEffectLayers){const t=i.style._mergedLayers[a[e]];if(t.isHidden(i.transform.zoom))continue;const n=i.style.getLayerSourceCache(t),o=n?this.proxyToSource[h.key][n.id]:[h];if(!o)continue;const s=o;r.viewport.set([0,0,d.fb.width,d.fb.height]),f!==(n?n.id:null)&&(this._setupStencil(d,o,t,n),f=n?n.id:null),i.renderLayer(i,n,t,s)}this.renderedToTile?(d.dirty=!0,l.push(o.tileID)):p||--c,5===c&&(c=0,this.renderToBackBuffer(l))}return this.renderToBackBuffer(l),this.renderingToTexture=!1,r.bindFramebuffer.set(null),r.viewport.set([0,0,i.width,i.height]),s.end+1}postRender(){}isLayerOrderingCorrect(e){const t=e.order.length;let i=-1,r=t;for(let n=0;ni}getMinElevationBelowMSL(){let e=0;return this._visibleDemTiles.filter((e=>e.dem)).forEach((t=>{e=Math.min(e,t.dem.tree.minimums[0])})),0===e?e:(e-30)*this._exaggeration}raycast(e,t,i){if(!this._visibleDemTiles)return null;const r=this._visibleDemTiles.filter((e=>e.dem)).map((r=>{const n=r.tileID,o=1<(null!==e.t?e.t:Number.MAX_VALUE)-(null!==t.t?t.t:Number.MAX_VALUE)));for(const n of r){if(null==n.t)return null;const r=n.tile.dem.tree.raycast(n.minx,n.miny,n.maxx,n.maxy,e,t,i);if(null!=r)return r}return null}_createFBO(){const t=this.painter.context,i=t.gl,r=this.drapeBufferSize;t.activeTexture.set(i.TEXTURE0);const n=new e.T(t,{width:r[0],height:r[1],data:null},i.RGBA);n.bind(i.LINEAR,i.CLAMP_TO_EDGE);const o=t.createFramebuffer(r[0],r[1],!0,null);return o.colorAttachment.set(n.texture),o.depthAttachment=new oe(t,o.framebuffer),void 0===this._sharedDepthStencil?(this._sharedDepthStencil=t.createRenderbuffer(t.gl.DEPTH_STENCIL,r[0],r[1]),this._stencilRef=0,o.depthAttachment.set(this._sharedDepthStencil),t.clear({stencil:0})):o.depthAttachment.set(this._sharedDepthStencil),t.extTextureFilterAnisotropic&&i.texParameterf(i.TEXTURE_2D,t.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,t.extTextureFilterAnisotropicMax),{fb:o,tex:n,dirty:!1}}_initFBOPool(){for(;this.pool.length{const t=this._style._mergedLayers[e],i=t.isHidden(this.painter.transform.zoom);return"custom"===t.type?!i&&t.shouldRedrape():!i&&t.hasTransition()}))}_clearLineLayersFromRenderCache(){let t=!1;for(const e of this._style.getSources())if(e instanceof Nt){t=!0;break}if(!t)return;const i={};for(let t=0;te>t.end))||e.w("fill-extrusion with flood lighting and/or ground ambient occlusion should be moved to be on top of all draped layers.")}this._drapedRenderBatches=r}_setupRenderCache(e){const t=this.proxySourceCache;if(this._shouldDisableRenderCache()||this.invalidateRenderCache){if(this.invalidateRenderCache=!1,t.renderCache.length>t.renderCachePool.length){const e=Object.values(t.proxyCachedFBO);t.proxyCachedFBO={};for(let i=0;i=0;n--){const o=i[n];if(t.getTileByID(o.key),void 0!==t.proxyCachedFBO[o.key]){const i=e[o.key],n=this.proxyToSource[o.key];let s=0;for(const e in n){const t=n[e],o=i[e];if(!o||o.length!==t.length||t.some(((t,i)=>t!==o[i]||r[e]&&r[e].hasOwnProperty(t.key)))){s=-1;break}++s}for(const e in t.proxyCachedFBO[o.key])t.renderCache[t.proxyCachedFBO[o.key][e]].dirty=s<0||s!==Object.values(i).length}}const n=[...this._drapedRenderBatches];n.sort(((e,t)=>t.end-t.start-(e.end-e.start)));for(const e of n)for(const r of i){if(t.proxyCachedFBO[r.key])continue;let i=t.renderCachePool.pop();void 0===i&&t.renderCache.length<50&&(i=t.renderCache.length,t.renderCache.push(this._createFBO())),void 0!==i&&(t.proxyCachedFBO[r.key]={},t.proxyCachedFBO[r.key][e.start]=i,t.renderCache[i].dirty=!0)}this._tilesDirty={}}_setupStencil(e,t,i,r){if(!r||!this._sourceTilesOverlap[r.id])return void(this._overlapStencilType&&(this._overlapStencilType=!1));const n=this.painter.context,o=n.gl;if(t.length<=1)return void(this._overlapStencilType=!1);let s;if(i.isTileClipped())s=t.length,this._overlapStencilMode.test={func:o.EQUAL,mask:255},this._overlapStencilType="Clip";else{if(!(t[0].overscaledZ>t[t.length-1].overscaledZ))return void(this._overlapStencilType=!1);s=1,this._overlapStencilMode.test={func:o.GREATER,mask:255},this._overlapStencilType="Mask"}this._stencilRef+s>255&&(n.clear({stencil:0}),this._stencilRef=0),this._stencilRef+=s,this._overlapStencilMode.ref=this._stencilRef,i.isTileClipped()&&this._renderTileClippingMasks(t,this._overlapStencilMode.ref)}clipOrMaskOverlapStencilType(){return"Clip"===this._overlapStencilType||"Mask"===this._overlapStencilType}stencilModeForRTTOverlap(t){return this.renderingToTexture&&this._overlapStencilType?("Clip"===this._overlapStencilType&&(this._overlapStencilMode.ref=this.painter._tileClippingMaskIDs[t.key]),this._overlapStencilMode):e.ah.disabled}_renderTileClippingMasks(t,i){const r=this.painter,n=this.painter.context,o=n.gl;r._tileClippingMaskIDs={},n.setColorMode(e.a.disabled),n.setDepthMode(e.af.disabled);const s=r.getOrCreateProgram("clippingMask");for(const n of t){const t=r._tileClippingMaskIDs[n.key]=--i;s.draw(r,o.TRIANGLES,e.af.disabled,new e.ah({func:o.ALWAYS,mask:0},t,255,o.KEEP,o.KEEP,o.REPLACE),e.a.disabled,e.ag.disabled,Ci(n.projMatrix),"$clipping",r.tileExtentBuffer,r.quadTriangleIndexBuffer,r.tileExtentSegments)}}pointCoordinate(t){const i=this.painter.transform;if(t.x<0||t.x>i.width||t.y<0||t.y>i.height)return null;const r=[t.x,t.y,1,1];e.aB.transformMat4(r,r,i.pixelMatrixInverse),e.aB.scale(r,r,1/r[3]),r[0]/=i.worldSize,r[1]/=i.worldSize;const n=i._camera.position,o=e.ay(1,i.center.lat),s=[n[0],n[1],n[2]/o,0],a=e.$.subtract([],r.slice(0,3),s);e.$.normalize(a,a);const l=this.raycast(s,a,this._exaggeration);return null!==l&&l?(e.$.scaleAndAdd(s,s,a,l),s[3]=s[2],s[2]*=o,s):null}_setupProxiedCoordsForOrtho(t,i,r){if(t.getSource()instanceof e.bo)return this._setupProxiedCoordsForImageSource(t,i,r);this._findCoveringTileCache[t.id]=this._findCoveringTileCache[t.id]||{};const n=this.proxiedCoords[t.id]=[],o=this.proxyCoords;for(let e=0;et.overscaledZ-e.overscaledZ))}_setupProxiedCoordsForImageSource(t,i,r){if(!t.getSource().loaded())return;const n=this.proxiedCoords[t.id]=[],o=this.proxyCoords,s=t.getSource(),a=s.tileID;if(!a)return;const l=new e.P(a.x,a.y)._div(1<(e.min.x=Math.min(e.min.x,t.x-l.x),e.min.y=Math.min(e.min.y,t.y-l.y),e.max.x=Math.max(e.max.x,t.x-l.x),e.max.y=Math.max(e.max.y,t.y-l.y),e)),{min:new e.P(Number.MAX_VALUE,Number.MAX_VALUE),max:new e.P(-Number.MAX_VALUE,-Number.MAX_VALUE)}),h=(t,i)=>{const r=t.wrap+t.canonical.x/(1<s+c.max.x||n+oa+c.max.y};for(let e=0;ee.key===i.tileID.key));if(e)return e}if(i.tileID.key!==t.key){const r=t.canonical.z-i.tileID.canonical.z;let o,s,a;n=e.ae.create();const l=i.tileID.wrap-t.wrap<0?(o=e.a4>>r,s=o*((i.tileID.canonical.x<=n){const r=t.canonical.z-n;i.getSource().reparseOverscaled?(a=Math.max(t.canonical.z+2,i.transform.tileZoom),s=new e.aQ(a,t.wrap,n,t.canonical.x>>r,t.canonical.y>>r)):0!==r&&(a=n,s=new e.aQ(a,t.wrap,n,t.canonical.x>>r,t.canonical.y>>r))}s.key!==t.key&&(c.push(s.key),r=i.getTile(s))}const h=e=>{c.forEach((t=>{n[t]=e})),c.length=0};for(a-=1;a>=l&&(!r||!r.hasData());a--){r&&h(r.tileID.key);const e=s.calculateScaledKey(a);if(r=i.getTileByID(e),r&&r.hasData())break;const t=n[e];if(null===t)break;void 0===t?c.push(e):r=i.getTileByID(t)}return h(r?r.tileID.key:null),r&&r.hasData()?r:null}findDEMTileFor(e){return this.enabled?this._findTileCoveringTileID(e,this.sourceCache):null}prepareDrawTile(){this.renderedToTile=!0}_clearRenderCacheForTile(e,t){let i=this._tilesDirty[e];i||(i=this._tilesDirty[e]={}),i[t.key]=!0}}function Fi(t,i,r){const n=(function(t,i,r){const n=e.$.dot(i,t),o=e.$.dot(r,[.2126,.7152,.0722]),s=(e,t,i)=>(1-i)*e+i*t,a=s(1-.3*Math.min(o,1),1,Math.min(n+1,1));return s(.92,1,Math.asin(e.au(i[2],-1,1))/Math.PI+.5)*a})(t,[0,0,1],i),o=[0,0,0];e.$.scale(o,r.slice(0,3),n);const s=[0,0,0];e.$.scale(s,i.slice(0,3),t[2]);const a=[0,0,0];return e.$.add(a,o,s),e.ba(a)}const Ni=["fill","fillOutline","fillPattern","line","linePattern","background","backgroundPattern","hillshade","raster"],Vi=["stars","fillExtrusion","fillExtrusionGroundEffect","model","symbolSDF","symbolIcon","symbolTextAndIcon"];class Ui{static cacheKey(e,t,i,r){let n=`${t}${r?r.cacheKey:""}`;for(const t of i)e.usedDefines.includes(t)&&(n+=`/${t}`);return n}constructor(t,i,r,n,o,s){const a=t.gl;this.program=a.createProgram(),this.configuration=n,this.name=i,this.fixedDefines=[...s];const l=n?n.getBinderAttributes():[],c=(r.staticAttributes||[]).concat(l);let h=n?n.defines():[];h=h.concat(s.map((e=>`#define ${e}`)));const u="#version 300 es\n";let d=u+h.concat("precision mediump float;",At,Mt.fragmentSource).join("\n");for(const e of r.fragmentIncludes)d+=`\n${Et[e]}`;d+=`\n${r.fragmentSource}`;let p=u+h.concat("precision highp float;",At,Mt.vertexSource).join("\n");for(const e of r.vertexIncludes)p+=`\n${Et[e]}`;p+=`\n${r.vertexSource}`;const f=a.createShader(a.FRAGMENT_SHADER);if(a.isContextLost())return void(this.failedToCreate=!0);a.shaderSource(f,d),a.compileShader(f),a.attachShader(this.program,f);const m=a.createShader(a.VERTEX_SHADER);if(a.isContextLost())this.failedToCreate=!0;else{a.shaderSource(m,p),a.compileShader(m),a.attachShader(this.program,m),this.attributes={},this.numAttributes=c.length;for(let e=0;e({u_dem:new e.a8(t),u_dem_prev:new e.a8(t),u_dem_tl:new e.a9(t),u_dem_scale:new e.ab(t),u_dem_tl_prev:new e.a9(t),u_dem_scale_prev:new e.ab(t),u_dem_size:new e.ab(t),u_dem_lerp:new e.ab(t),u_exaggeration:new e.ab(t),u_depth:new e.a8(t),u_depth_size_inv:new e.a9(t),u_depth_range_unpack:new e.a9(t),u_occluder_half_size:new e.ab(t),u_occlusion_depth_offset:new e.ab(t),u_meter_to_dem:new e.ab(t),u_label_plane_matrix_inv:new e.a7(t)}))(t)),s.includes("GLOBE")&&(this.globeUniforms=(t=>({u_tile_tl_up:new e.ar(t),u_tile_tr_up:new e.ar(t),u_tile_br_up:new e.ar(t),u_tile_bl_up:new e.ar(t),u_tile_up_scale:new e.ab(t)}))(t)),s.includes("FOG")&&(this.fogUniforms=(t=>({u_fog_matrix:new e.a7(t),u_fog_range:new e.a9(t),u_fog_color:new e.at(t),u_fog_horizon_blend:new e.ab(t),u_fog_vertical_limit:new e.a9(t),u_fog_temporal_offset:new e.ab(t),u_frustum_tl:new e.ar(t),u_frustum_tr:new e.ar(t),u_frustum_br:new e.ar(t),u_frustum_bl:new e.ar(t),u_globe_pos:new e.ar(t),u_globe_radius:new e.ab(t),u_globe_transition:new e.ab(t),u_is_globe:new e.a8(t),u_viewport:new e.a9(t)}))(t)),s.includes("RENDER_CUTOFF")&&(this.cutoffUniforms=(t=>({u_cutoff_params:new e.at(t)}))(t)),s.includes("LIGHTING_3D_MODE")&&(this.lightsUniforms=(t=>({u_lighting_ambient_color:new e.ar(t),u_lighting_directional_dir:new e.ar(t),u_lighting_directional_color:new e.ar(t),u_ground_radiance:new e.ar(t)}))(t)),s.includes("RENDER_SHADOWS")&&(this.shadowUniforms=(t=>({u_light_matrix_0:new e.a7(t),u_light_matrix_1:new e.a7(t),u_fade_range:new e.a9(t),u_shadow_normal_offset:new e.ar(t),u_shadow_intensity:new e.ab(t),u_shadow_texel_size:new e.ab(t),u_shadow_map_resolution:new e.ab(t),u_shadow_direction:new e.ar(t),u_shadow_bias:new e.ar(t),u_shadowmap_0:new e.a8(t),u_shadowmap_1:new e.a8(t)}))(t))}}setTerrainUniformValues(e,t){if(!this.terrainUniforms)return;const i=this.terrainUniforms;if(!this.failedToCreate){e.program.set(this.program);for(const e in t)i[e]&&i[e].set(this.program,e,t[e])}}setGlobeUniformValues(e,t){if(!this.globeUniforms)return;const i=this.globeUniforms;if(!this.failedToCreate){e.program.set(this.program);for(const e in t)i[e]&&i[e].set(this.program,e,t[e])}}setFogUniformValues(e,t){if(!this.fogUniforms)return;const i=this.fogUniforms;if(!this.failedToCreate){e.program.set(this.program);for(const e in t)i[e].set(this.program,e,t[e])}}setCutoffUniformValues(e,t){if(!this.cutoffUniforms)return;const i=this.cutoffUniforms;if(!this.failedToCreate){e.program.set(this.program);for(const e in t)i[e].set(this.program,e,t[e])}}setLightsUniformValues(e,t){if(!this.lightsUniforms)return;const i=this.lightsUniforms;if(!this.failedToCreate){e.program.set(this.program);for(const e in t)i[e].set(this.program,e,t[e])}}setShadowUniformValues(e,t){if(this.failedToCreate||!this.shadowUniforms)return;const i=this.shadowUniforms;e.program.set(this.program);for(const e in t)i[e].set(this.program,e,t[e])}_drawDebugWireframe(t,i,r,n,o,s,a,l,c,h){const u=t.options.wireframe;if(!1===u.terrain&&!1===u.layers2D&&!1===u.layers3D)return;const d=t.context;if(!(()=>!(!u.terrain||"terrainRaster"!==this.name&&"globeRaster"!==this.name)||!(!u.layers2D||t._terrain&&t._terrain.renderingToTexture||!Ni.includes(this.name))||!(!u.layers3D||!Vi.includes(this.name)))())return;const p=d.gl,f=t.wireframeDebugCache.getLinesFromTrianglesBuffer(t.frameCounter,o,d);if(!f)return;const m=[...this.fixedDefines];m.push("DEBUG_WIREFRAME");const _=t.getOrCreateProgram(this.name,{config:this.configuration,defines:m});d.program.set(_.program);const g=(e,t,i)=>{if(t[e]&&i[e])for(const r in t[e])i[e][r]&&i[e][r].set(i.program,r,t[e][r].current)};c&&c.setUniforms(_.program,d,_.binderUniforms,a,{zoom:l}),g("fixedUniforms",this,_),g("terrainUniforms",this,_),g("globeUniforms",this,_),g("fogUniforms",this,_),g("lightsUniforms",this,_),g("shadowUniforms",this,_),f.bind(),d.setColorMode(new e.a([p.ONE,p.ONE_MINUS_SRC_ALPHA,p.ZERO,p.ONE],e.C.transparent,[!0,!0,!0,!1])),d.setDepthMode(new e.af(i.func===p.LESS?p.LEQUAL:i.func,e.af.ReadOnly,i.range)),d.setStencilMode(e.ah.disabled);const y=3*s.primitiveLength*2,x=3*s.primitiveOffset*2*2;h&&h>1?p.drawElementsInstanced(p.LINES,y,p.UNSIGNED_SHORT,x,h):p.drawElements(p.LINES,y,p.UNSIGNED_SHORT,x),o.bind(),d.program.set(this.program),d.setDepthMode(i),d.setStencilMode(r),d.setColorMode(n)}draw(e,t,i,r,n,o,s,a,l,c,h,u,d,p,f,m){const _=e.context,g=_.gl;if(this.failedToCreate)return;_.program.set(this.program),_.setDepthMode(i),_.setStencilMode(r),_.setColorMode(n),_.setCullFace(o);for(const e of Object.keys(this.fixedUniforms))this.fixedUniforms[e].set(this.program,e,s[e]);p&&p.setUniforms(this.program,_,this.binderUniforms,u,{zoom:d});const y={[g.POINTS]:1,[g.LINES]:2,[g.TRIANGLES]:3,[g.LINE_STRIP]:1}[t],x=m&&m>0?1:void 0;for(const o of h.get()){const s=o.vaos||(o.vaos={});(s[a]||(s[a]=new zt)).bind(_,this,l,p?p.getPaintVertexBuffers():[],c,o.vertexOffset,f||[],x),m&&m>1?g.drawElementsInstanced(t,o.primitiveLength*y,g.UNSIGNED_SHORT,o.primitiveOffset*y*2,m):c?g.drawElements(t,o.primitiveLength*y,g.UNSIGNED_SHORT,o.primitiveOffset*y*2):g.drawArrays(t,o.vertexOffset,o.vertexLength),t===g.TRIANGLES&&c&&this._drawDebugWireframe(e,i,r,n,c,o,u,d,p,m)}}}function ji(t,i){const r=Math.pow(2,i.tileID.overscaledZ),n=i.tileSize*Math.pow(2,t.transform.tileZoom)/r,o=n*(i.tileID.canonical.x+i.tileID.wrap*r),s=n*i.tileID.canonical.y;return{u_image:0,u_texsize:i.imageAtlasTexture?i.imageAtlasTexture.size:[0,0],u_tile_units_to_pixels:1/e.bD(i,1,t.transform.tileZoom),u_pixel_coord_upper:[o>>16,s>>16],u_pixel_coord_lower:[65535&o,65535&s]}}const $i=e.ae.create(),Gi=(t,i,r,n,o,s,a,l,c,h,u,d,p,f,m,_,g,y)=>{const x=i.style.light,v=x.properties.get("position"),b=[v.x,v.y,v.z],w=e.bE.create();"viewport"===x.properties.get("anchor")&&(e.bE.fromRotation(w,-i.transform.angle),e.$.transformMat3(b,b,w));const T=x.properties.get("color"),E=i.transform,S={u_matrix:t,u_lightpos:b,u_lightintensity:x.properties.get("intensity"),u_lightcolor:[T.r,T.g,T.b],u_vertical_gradient:+r,u_opacity:n,u_tile_id:[0,0,0],u_zoom_transition:0,u_inv_rot_matrix:$i,u_merc_center:[0,0],u_up_dir:[0,0,0],u_height_lift:0,u_ao:o,u_edge_radius:s,u_alignment:a,u_width_scale:l,u_flood_light_color:f,u_vertical_scale:m,u_flood_light_intensity:_,u_ground_shadow_factor:g,u_emissive_strength:y};return"globe"===E.projection.name&&(S.u_tile_id=[c.canonical.x,c.canonical.y,1<({u_matrix:e,u_edge_radius:t,u_alignment:i,u_width_scale:r,u_vertical_scale:n}),Zi=(t,i,r,n,o,s,a,l,c,h,u,d,p,f,m,_)=>{const g=Gi(t,i,r,n,o,s,a,l,c,u,d,p,f,m,_,1,[0,0,0],0),y={u_height_factor:-Math.pow(2,c.overscaledZ)/h.tileSize/8};return e.Q(g,ji(i,h),y)},Wi=(e,t)=>({u_matrix:e,u_emissive_strength:t}),Hi=(t,i,r,n)=>e.Q(Wi(t,i),ji(r,n)),Xi=(e,t,i)=>({u_matrix:e,u_world:i,u_emissive_strength:t}),Yi=(t,i,r,n,o)=>e.Q(Hi(t,i,r,n),{u_world:o}),Ji=(t,i,r,n)=>{const o=e.a4/r.tileSize;return{u_matrix:t,u_camera_to_center_distance:i.getCameraToCenterDistance(n),u_extrude_scale:[i.pixelsToGLUnits[0]/o,i.pixelsToGLUnits[1]/o]}},Ki=(e,t,i=1)=>({u_matrix:e,u_color:t.toRenderColor(null),u_overlay:0,u_overlay_scale:i}),Qi=e.ae.create(),er=(t,i,r,n,o,s,a)=>{const l=t.transform,c="globe"===l.projection.name,h=c?e.bF(l.zoom,i.canonical)*l._pixelsPerMercatorPixel:e.bD(r,1,s),u={u_matrix:i.projMatrix,u_extrude_scale:h,u_intensity:a,u_inv_rot_matrix:Qi,u_merc_center:[0,0],u_tile_id:[0,0,0],u_zoom_transition:0,u_up_dir:[0,0,0]};if(c){u.u_inv_rot_matrix=n,u.u_merc_center=o,u.u_tile_id=[i.canonical.x,i.canonical.y,1<({u_matrix:t,u_normalize_matrix:i,u_globe_matrix:r,u_merc_matrix:n,u_grid_matrix:o,u_tl_parent:s,u_scale_parent:h,u_fade_t:u.mix,u_opacity:u.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:e.bG(d.paint.get("raster-saturation")),u_contrast_factor:e.bH(d.paint.get("raster-contrast")),u_spin_weights:nr(d.paint.get("raster-hue-rotate")),u_perspective_transform:p,u_raster_elevation:f,u_zoom_transition:a,u_merc_center:l,u_cutoff_params:c,u_colorization_mix:tr(e.bI,_,y),u_colorization_offset:ir(e.bI,g,y),u_color_ramp:m,u_texture_offset:[v/(x+2*v),x/(x+2*v)],u_texture_res:[x+2*v,x+2*v],u_emissive_strength:b});function nr(e){e*=Math.PI/180;const t=Math.sin(e),i=Math.cos(e);return[(2*i+1)/3,(-Math.sqrt(3)*t-i+1)/3,(Math.sqrt(3)*t-i+1)/3]}const or=.05,sr=(e,t,i,r,n,o,s,a,l,c,h,u)=>({u_matrix:e,u_normalize_matrix:t,u_globe_matrix:i,u_merc_matrix:r,u_grid_matrix:n,u_tl_parent:o,u_scale_parent:c,u_fade_t:h.mix,u_opacity:h.opacity,u_image0:0,u_image1:1,u_raster_elevation:u,u_zoom_transition:s,u_merc_center:a,u_cutoff_params:l}),ar=(e,t,i,r,n,o,s,a,l,c)=>({u_particle_texture:e,u_particle_texture_side_len:t,u_tile_offset:i,u_velocity:r,u_color_ramp:o,u_velocity_res:n,u_max_speed:s,u_uv_offset:a,u_data_scale:[255*l[0],255*l[1]],u_data_offset:c,u_particle_pos_scale:1.1,u_particle_pos_offset:[or,or]}),lr=(e,t,i,r,n,o,s,a,l,c)=>({u_particle_texture:e,u_particle_texture_side_len:t,u_velocity:i,u_velocity_res:r,u_max_speed:n,u_speed_factor:o,u_reset_rate:s,u_rand_seed:Math.random(),u_uv_offset:a,u_data_scale:[255*l[0],255*l[1]],u_data_offset:c,u_particle_pos_scale:1.1,u_particle_pos_offset:[or,or]}),cr=e.ae.create(),hr=(t,i,r,n,o,s,a,l,c,h,u,d,p,f,m,_,g,y)=>{const x=o.transform,v={u_is_size_zoom_constant:+("constant"===t||"source"===t),u_is_size_feature_constant:+("constant"===t||"camera"===t),u_size_t:i?i.uSizeT:0,u_size:i?i.uSize:0,u_camera_to_center_distance:x.getCameraToCenterDistance(_),u_rotate_symbol:+r,u_aspect_ratio:x.width/x.height,u_fade_change:o.options.fadeDuration?o.symbolFadeChange:1,u_matrix:s,u_label_plane_matrix:a,u_coord_matrix:l,u_is_text:+c,u_pitch_with_map:+n,u_texsize:h,u_texture:0,u_tile_id:[0,0,0],u_zoom_transition:0,u_inv_rot_matrix:cr,u_merc_center:[0,0],u_camera_forward:[0,0,0],u_ecef_origin:[0,0,0],u_tile_matrix:cr,u_up_vector:[0,-1,0],u_color_adj_mat:g,u_icon_transition:y||0};return"globe"===_.name&&(v.u_tile_id=[u.canonical.x,u.canonical.y,1<e.Q(hr(t,i,r,n,o,s,a,l,c,h,d,p,f,m,_,g),{u_gamma_scale:n?o.transform.getCameraToCenterDistance(g)*Math.cos(o.terrain?0:o.transform._pitch):1,u_device_pixel_ratio:e.e.devicePixelRatio,u_is_halo:+u,undefined:void 0}),dr=(t,i,r,n,o,s,a,l,c,h,u,d,p,f,m,_)=>e.Q(ur(t,i,r,n,o,s,a,l,!0,c,!0,u,d,p,f,m,_),{u_texsize_icon:h,u_texture_icon:1}),pr=(e,t,i,r)=>({u_matrix:e,u_emissive_strength:t,u_opacity:i,u_color:r}),fr=(t,i,r,n,o,s,a,l)=>e.Q((function(t,i,r,n,o){const{width:s,height:a}=n.imageManager.getPixelSize(i),l=Math.pow(2,o.tileID.overscaledZ),c=o.tileSize*Math.pow(2,n.transform.tileZoom)/l,h=c*(o.tileID.canonical.x+o.tileID.wrap*l),u=c*o.tileID.canonical.y;return{u_image:0,u_pattern_tl:r.tl,u_pattern_br:r.br,u_texsize:[s,a],u_pattern_size:r.displaySize,u_tile_units_to_pixels:1/e.bD(o,1,n.transform.tileZoom),u_pixel_coord_upper:[h>>16,u>>16],u_pixel_coord_lower:[65535&h,65535&u]}})(0,s,a,n,l),{u_matrix:t,u_emissive_strength:i,u_opacity:r}),mr=new Float32Array(e.ae.identity([])),_r=(t,i,r,n,o,s,a,l,c,h,u,d,p,f=[0,0,0],m)=>{const _=o.style.light,g=_.properties.get("position"),y=[-g.x,-g.y,g.z],x=e.bE.create();"viewport"===_.properties.get("anchor")&&(e.bE.fromRotation(x,-o.transform.angle),e.$.transformMat3(y,y,x));const v="MASK"===u.alphaMode,b=_.properties.get("color").toRenderColor(null),w=p.paint.get("model-ambient-occlusion-intensity"),T=p.paint.get("model-color").constantOr(e.C.white).toRenderColor(null),E=p.paint.get("model-color-mix-intensity").constantOr(0);return{u_matrix:t,u_lighting_matrix:i,u_normal_matrix:r,u_node_matrix:n||mr,u_lightpos:y,u_lightintensity:_.properties.get("intensity"),u_lightcolor:[b.r,b.g,b.b],u_camera_pos:f,u_opacity:s,u_baseTextureIsAlpha:0,u_alphaMask:+v,u_alphaCutoff:u.alphaCutoff,u_baseColorFactor:[a.r,a.g,a.b,a.a],u_emissiveFactor:[l[0],l[1],l[2],1],u_metallicFactor:c,u_roughnessFactor:h,u_baseColorTexture:fi.BaseColor,u_metallicRoughnessTexture:fi.MetallicRoughness,u_normalTexture:fi.Normal,u_occlusionTexture:fi.Occlusion,u_emissionTexture:fi.Emission,u_lutTexture:fi.LUT,u_color_mix:[T.r,T.g,T.b,E],u_aoIntensity:w,u_emissive_strength:d,u_occlusionTextureTransform:m||[0,0,0,0]}},gr=(e,t=mr,i=mr)=>({u_matrix:e,u_instance:t,u_node_matrix:i}),yr={fillExtrusion:t=>({u_matrix:new e.a7(t),u_lightpos:new e.ar(t),u_lightintensity:new e.ab(t),u_lightcolor:new e.ar(t),u_vertical_gradient:new e.ab(t),u_opacity:new e.ab(t),u_edge_radius:new e.ab(t),u_alignment:new e.ab(t),u_width_scale:new e.ab(t),u_ao:new e.a9(t),u_tile_id:new e.ar(t),u_zoom_transition:new e.ab(t),u_inv_rot_matrix:new e.a7(t),u_merc_center:new e.a9(t),u_up_dir:new e.ar(t),u_height_lift:new e.ab(t),u_flood_light_color:new e.ar(t),u_vertical_scale:new e.ab(t),u_flood_light_intensity:new e.ab(t),u_ground_shadow_factor:new e.ar(t),u_emissive_strength:new e.ab(t)}),fillExtrusionDepth:t=>({u_matrix:new e.a7(t),u_edge_radius:new e.ab(t),u_alignment:new e.ab(t),u_width_scale:new e.ab(t),u_vertical_scale:new e.ab(t)}),fillExtrusionPattern:t=>({u_matrix:new e.a7(t),u_lightpos:new e.ar(t),u_lightintensity:new e.ab(t),u_lightcolor:new e.ar(t),u_vertical_gradient:new e.ab(t),u_height_factor:new e.ab(t),u_edge_radius:new e.ab(t),u_alignment:new e.ab(t),u_width_scale:new e.ab(t),u_ao:new e.a9(t),u_tile_id:new e.ar(t),u_zoom_transition:new e.ab(t),u_inv_rot_matrix:new e.a7(t),u_merc_center:new e.a9(t),u_up_dir:new e.ar(t),u_height_lift:new e.ab(t),u_image:new e.a8(t),u_texsize:new e.a9(t),u_pixel_coord_upper:new e.a9(t),u_pixel_coord_lower:new e.a9(t),u_tile_units_to_pixels:new e.ab(t),u_opacity:new e.ab(t)}),fillExtrusionGroundEffect:t=>({u_matrix:new e.a7(t),u_opacity:new e.ab(t),u_ao_pass:new e.ab(t),u_meter_to_tile:new e.ab(t),u_ao:new e.a9(t),u_flood_light_intensity:new e.ab(t),u_flood_light_color:new e.ar(t),u_attenuation:new e.ab(t),u_edge_radius:new e.ab(t),u_fb:new e.a8(t),u_fb_size:new e.ab(t)}),fill:t=>({u_matrix:new e.a7(t),u_emissive_strength:new e.ab(t)}),fillPattern:t=>({u_matrix:new e.a7(t),u_emissive_strength:new e.ab(t),u_image:new e.a8(t),u_texsize:new e.a9(t),u_pixel_coord_upper:new e.a9(t),u_pixel_coord_lower:new e.a9(t),u_tile_units_to_pixels:new e.ab(t)}),fillOutline:t=>({u_matrix:new e.a7(t),u_emissive_strength:new e.ab(t),u_world:new e.a9(t)}),fillOutlinePattern:t=>({u_matrix:new e.a7(t),u_emissive_strength:new e.ab(t),u_world:new e.a9(t),u_image:new e.a8(t),u_texsize:new e.a9(t),u_pixel_coord_upper:new e.a9(t),u_pixel_coord_lower:new e.a9(t),u_tile_units_to_pixels:new e.ab(t)}),circle:e.bK,collisionBox:t=>({u_matrix:new e.a7(t),u_camera_to_center_distance:new e.ab(t),u_extrude_scale:new e.a9(t)}),collisionCircle:t=>({u_matrix:new e.a7(t),u_inv_matrix:new e.a7(t),u_camera_to_center_distance:new e.ab(t),u_viewport_size:new e.a9(t)}),debug:t=>({u_color:new e.aa(t),u_matrix:new e.a7(t),u_overlay:new e.a8(t),u_overlay_scale:new e.ab(t)}),clippingMask:t=>({u_matrix:new e.a7(t)}),heatmap:t=>({u_extrude_scale:new e.ab(t),u_intensity:new e.ab(t),u_matrix:new e.a7(t),u_inv_rot_matrix:new e.a7(t),u_merc_center:new e.a9(t),u_tile_id:new e.ar(t),u_zoom_transition:new e.ab(t),u_up_dir:new e.ar(t)}),heatmapTexture:t=>({u_image:new e.a8(t),u_color_ramp:new e.a8(t),u_opacity:new e.ab(t)}),hillshade:t=>({u_matrix:new e.a7(t),u_image:new e.a8(t),u_latrange:new e.a9(t),u_light:new e.a9(t),u_shadow:new e.aa(t),u_highlight:new e.aa(t),u_emissive_strength:new e.ab(t),u_accent:new e.aa(t)}),hillshadePrepare:t=>({u_matrix:new e.a7(t),u_image:new e.a8(t),u_dimension:new e.a9(t),u_zoom:new e.ab(t)}),line:e.bL,linePattern:e.bM,raster:t=>({u_matrix:new e.a7(t),u_normalize_matrix:new e.a7(t),u_globe_matrix:new e.a7(t),u_merc_matrix:new e.a7(t),u_grid_matrix:new e.as(t),u_tl_parent:new e.a9(t),u_scale_parent:new e.ab(t),u_fade_t:new e.ab(t),u_opacity:new e.ab(t),u_image0:new e.a8(t),u_image1:new e.a8(t),u_brightness_low:new e.ab(t),u_brightness_high:new e.ab(t),u_saturation_factor:new e.ab(t),u_contrast_factor:new e.ab(t),u_spin_weights:new e.ar(t),u_perspective_transform:new e.a9(t),u_raster_elevation:new e.ab(t),u_zoom_transition:new e.ab(t),u_merc_center:new e.a9(t),u_cutoff_params:new e.at(t),u_colorization_mix:new e.at(t),u_colorization_offset:new e.ab(t),u_color_ramp:new e.a8(t),u_texture_offset:new e.a9(t),u_texture_res:new e.a9(t),u_emissive_strength:new e.ab(t)}),rasterParticle:t=>({u_matrix:new e.a7(t),u_normalize_matrix:new e.a7(t),u_globe_matrix:new e.a7(t),u_merc_matrix:new e.a7(t),u_grid_matrix:new e.as(t),u_tl_parent:new e.a9(t),u_scale_parent:new e.ab(t),u_fade_t:new e.ab(t),u_opacity:new e.ab(t),u_image0:new e.a8(t),u_image1:new e.a8(t),u_raster_elevation:new e.ab(t),u_zoom_transition:new e.ab(t),u_merc_center:new e.a9(t),u_cutoff_params:new e.at(t)}),rasterParticleTexture:t=>({u_texture:new e.a8(t),u_opacity:new e.ab(t)}),rasterParticleDraw:t=>({u_particle_texture:new e.a8(t),u_particle_texture_side_len:new e.ab(t),u_tile_offset:new e.a9(t),u_velocity:new e.a8(t),u_color_ramp:new e.a8(t),u_velocity_res:new e.a9(t),u_max_speed:new e.ab(t),u_uv_offset:new e.a9(t),u_data_scale:new e.a9(t),u_data_offset:new e.ab(t),u_particle_pos_scale:new e.ab(t),u_particle_pos_offset:new e.a9(t)}),rasterParticleUpdate:t=>({u_particle_texture:new e.a8(t),u_particle_texture_side_len:new e.ab(t),u_velocity:new e.a8(t),u_velocity_res:new e.a9(t),u_max_speed:new e.ab(t),u_speed_factor:new e.ab(t),u_reset_rate:new e.ab(t),u_rand_seed:new e.ab(t),u_uv_offset:new e.a9(t),u_data_scale:new e.a9(t),u_data_offset:new e.ab(t),u_particle_pos_scale:new e.ab(t),u_particle_pos_offset:new e.a9(t)}),symbolIcon:t=>({u_is_size_zoom_constant:new e.a8(t),u_is_size_feature_constant:new e.a8(t),u_size_t:new e.ab(t),u_size:new e.ab(t),u_camera_to_center_distance:new e.ab(t),u_rotate_symbol:new e.a8(t),u_aspect_ratio:new e.ab(t),u_fade_change:new e.ab(t),u_matrix:new e.a7(t),u_label_plane_matrix:new e.a7(t),u_coord_matrix:new e.a7(t),u_is_text:new e.a8(t),u_pitch_with_map:new e.a8(t),u_texsize:new e.a9(t),u_tile_id:new e.ar(t),u_zoom_transition:new e.ab(t),u_inv_rot_matrix:new e.a7(t),u_merc_center:new e.a9(t),u_camera_forward:new e.ar(t),u_tile_matrix:new e.a7(t),u_up_vector:new e.ar(t),u_ecef_origin:new e.ar(t),u_texture:new e.a8(t),u_icon_transition:new e.ab(t),u_color_adj_mat:new e.a7(t)}),symbolSDF:t=>({u_is_size_zoom_constant:new e.a8(t),u_is_size_feature_constant:new e.a8(t),u_size_t:new e.ab(t),u_size:new e.ab(t),u_camera_to_center_distance:new e.ab(t),u_rotate_symbol:new e.a8(t),u_aspect_ratio:new e.ab(t),u_fade_change:new e.ab(t),u_matrix:new e.a7(t),u_label_plane_matrix:new e.a7(t),u_coord_matrix:new e.a7(t),u_is_text:new e.a8(t),u_pitch_with_map:new e.a8(t),u_texsize:new e.a9(t),u_texture:new e.a8(t),u_gamma_scale:new e.ab(t),u_device_pixel_ratio:new e.ab(t),u_tile_id:new e.ar(t),u_zoom_transition:new e.ab(t),u_inv_rot_matrix:new e.a7(t),u_merc_center:new e.a9(t),u_camera_forward:new e.ar(t),u_tile_matrix:new e.a7(t),u_up_vector:new e.ar(t),u_ecef_origin:new e.ar(t),u_is_halo:new e.a8(t)}),symbolTextAndIcon:t=>({u_is_size_zoom_constant:new e.a8(t),u_is_size_feature_constant:new e.a8(t),u_size_t:new e.ab(t),u_size:new e.ab(t),u_camera_to_center_distance:new e.ab(t),u_rotate_symbol:new e.a8(t),u_aspect_ratio:new e.ab(t),u_fade_change:new e.ab(t),u_matrix:new e.a7(t),u_label_plane_matrix:new e.a7(t),u_coord_matrix:new e.a7(t),u_is_text:new e.a8(t),u_pitch_with_map:new e.a8(t),u_texsize:new e.a9(t),u_texsize_icon:new e.a9(t),u_texture:new e.a8(t),u_texture_icon:new e.a8(t),u_gamma_scale:new e.ab(t),u_device_pixel_ratio:new e.ab(t),u_is_halo:new e.a8(t)}),background:t=>({u_matrix:new e.a7(t),u_emissive_strength:new e.ab(t),u_opacity:new e.ab(t),u_color:new e.aa(t)}),backgroundPattern:t=>({u_matrix:new e.a7(t),u_emissive_strength:new e.ab(t),u_opacity:new e.ab(t),u_image:new e.a8(t),u_pattern_tl:new e.a9(t),u_pattern_br:new e.a9(t),u_texsize:new e.a9(t),u_pattern_size:new e.a9(t),u_pixel_coord_upper:new e.a9(t),u_pixel_coord_lower:new e.a9(t),u_tile_units_to_pixels:new e.ab(t)}),terrainRaster:t=>({u_matrix:new e.a7(t),u_image0:new e.a8(t),u_skirt_height:new e.ab(t),u_ground_shadow_factor:new e.ar(t)}),skybox:t=>({u_matrix:new e.a7(t),u_sun_direction:new e.ar(t),u_cubemap:new e.a8(t),u_opacity:new e.ab(t),u_temporal_offset:new e.ab(t)}),skyboxGradient:t=>({u_matrix:new e.a7(t),u_color_ramp:new e.a8(t),u_center_direction:new e.ar(t),u_radius:new e.ab(t),u_opacity:new e.ab(t),u_temporal_offset:new e.ab(t)}),skyboxCapture:t=>({u_matrix_3f:new e.as(t),u_sun_direction:new e.ar(t),u_sun_intensity:new e.ab(t),u_color_tint_r:new e.at(t),u_color_tint_m:new e.at(t),u_luminance:new e.ab(t)}),globeRaster:t=>({u_proj_matrix:new e.a7(t),u_globe_matrix:new e.a7(t),u_normalize_matrix:new e.a7(t),u_merc_matrix:new e.a7(t),u_zoom_transition:new e.ab(t),u_merc_center:new e.a9(t),u_image0:new e.a8(t),u_grid_matrix:new e.as(t),u_skirt_height:new e.ab(t),u_far_z_cutoff:new e.ab(t),u_frustum_tl:new e.ar(t),u_frustum_tr:new e.ar(t),u_frustum_br:new e.ar(t),u_frustum_bl:new e.ar(t),u_globe_pos:new e.ar(t),u_globe_radius:new e.ab(t),u_viewport:new e.a9(t)}),globeAtmosphere:t=>({u_frustum_tl:new e.ar(t),u_frustum_tr:new e.ar(t),u_frustum_br:new e.ar(t),u_frustum_bl:new e.ar(t),u_horizon:new e.ab(t),u_transition:new e.ab(t),u_fadeout_range:new e.ab(t),u_color:new e.at(t),u_high_color:new e.at(t),u_space_color:new e.at(t),u_temporal_offset:new e.ab(t),u_horizon_angle:new e.ab(t)}),model:t=>({u_matrix:new e.a7(t),u_lighting_matrix:new e.a7(t),u_normal_matrix:new e.a7(t),u_node_matrix:new e.a7(t),u_lightpos:new e.ar(t),u_lightintensity:new e.ab(t),u_lightcolor:new e.ar(t),u_camera_pos:new e.ar(t),u_opacity:new e.ab(t),u_baseColorFactor:new e.at(t),u_emissiveFactor:new e.at(t),u_metallicFactor:new e.ab(t),u_roughnessFactor:new e.ab(t),u_baseTextureIsAlpha:new e.a8(t),u_alphaMask:new e.a8(t),u_alphaCutoff:new e.ab(t),u_baseColorTexture:new e.a8(t),u_metallicRoughnessTexture:new e.a8(t),u_normalTexture:new e.a8(t),u_occlusionTexture:new e.a8(t),u_emissionTexture:new e.a8(t),u_lutTexture:new e.a8(t),u_color_mix:new e.at(t),u_aoIntensity:new e.ab(t),u_emissive_strength:new e.ab(t),u_occlusionTextureTransform:new e.at(t)}),modelDepth:t=>({u_matrix:new e.a7(t),u_instance:new e.a7(t),u_node_matrix:new e.a7(t)}),groundShadow:t=>({u_matrix:new e.a7(t),u_ground_shadow_factor:new e.ar(t)}),stars:t=>({u_matrix:new e.a7(t),u_up:new e.ar(t),u_right:new e.ar(t),u_intensity_multiplier:new e.ab(t)}),occlusion:t=>({u_matrix:new e.a7(t),u_anchorPos:new e.ar(t),u_screenSizePx:new e.a9(t),u_occluderSizePx:new e.a9(t),u_color:new e.at(t)})};function xr(t,i,r){const n=i.createTileMatrix(t,t.worldSize,r.toUnwrapped());return e.ae.multiply(new Float32Array(16),t.projMatrix,n)}function vr(e,t,i){if(t.projection.name===i.projection.name)return e.projMatrix;const r=i.clone();return r.setProjection(t.projection),xr(r,t.getProjection(),e)}function br(e,t,i){return t.name===i.projection.name?e.projMatrix:xr(i,t,e)}let wr;function Tr(t,i,r,n,o,s,a){const l=t.context,c=l.gl,h=t.transform,u=t.getOrCreateProgram("collisionBox"),d=[];let p=0,f=0;for(let l=0;l0){const t=e.ae.create(),i=x;e.ae.mul(t,g.placementInvProjMatrix,h.glCoordMatrix),e.ae.mul(t,t,g.placementViewportMatrix),d.push({circleArray:b,circleOffset:f,transform:i,invTransform:t,projection:g.getProjection()}),p+=b.length/4,f=p}v&&(t.terrain&&t.terrain.setupElevationDraw(_,u),u.draw(t,c.LINES,e.af.disabled,e.ah.disabled,t.colorModeForRenderPass(),e.ag.disabled,Ji(x,h,_,g.getProjection()),r.id,v.layoutVertexBuffer,v.indexBuffer,v.segments,null,h.zoom,null,[v.collisionVertexBuffer,v.collisionVertexBufferExt]))}if(!a||!d.length)return;const m=t.getOrCreateProgram("collisionCircle"),_=new e.bN;_.resize(4*p),_._trim();let g=0;for(const e of d)for(let t=0;t=0&&(m[v.associatedIconIndex]={x:S,y:M,z:A,angle:D})}else ci(T,p)}if(u){f.clear();const i=t.icon.placedSymbolArray;for(let t=0;t{E.depthOcclusionForSymbolsAndCircles&&(r.hasInitialOcclusionOpacityProperties||t.terrain)&&(e.push("DEPTH_D24"),e.push("DEPTH_OCCLUSION"))},N=()=>{const i=S&&"point"!==r.layout.get("symbol-placement"),a=[];F(a);const c=i||z,u=r.paint.get("icon-image-cross-fade").constantOr(0);t.terrainRenderModeElevated()&&A&&a.push("PITCH_WITH_MAP_TERRAIN"),d&&(a.push("PROJECTION_GLOBE_VIEW"),c&&a.push("PROJECTED_POS_ON_VIEWPORT")),u>0&&a.push("ICON_TRANSITION"),s.icon.zOffsetVertexBuffer&&a.push("Z_OFFSET"),0===y&&0===x&&0===v&&1===b||a.push("COLOR_ADJUSTMENT");const g=s.icon.programConfigurations.get(r.id),w=t.getOrCreateProgram(s.sdfIcons?"symbolSDF":"symbolIcon",{config:g,defines:a});let M;const I=n.imageAtlasTexture?n.imageAtlasTexture.size:[0,0],C=s.iconSizeData,P=e.aE(C,E.zoom),R=A||0!==E.pitch,k=Yt(f,n.tileID.canonical,A,S,E,s.getProjection(),m),N=Kt(f,n.tileID.canonical,A,S,E,s.getProjection(),m),V=t.translatePosMatrix(N,n,l,h,!0),U=t.translatePosMatrix(f,n,l,h),j=c?Er:k,$=S&&!A&&!i;let G=O;!L&&!E.mercatorFromTransition||S||(G=Sr(E));const q=d?G:O;if(s.sdfIcons&&!s.iconsInText)M=ur(C.kind,P,$,A,t,U,j,V,!1,I,!0,o,p,D,B,q,s.getProjection());else{const e=r.getColorAdjustmentMatrix(y,x,v,b);M=hr(C.kind,P,$,A,t,U,j,V,!1,I,o,p,D,B,q,s.getProjection(),e,u)}const Z=n.imageAtlasTexture?n.imageAtlasTexture:null,W=1!==r.layout.get("icon-size").constantOr(0)||s.iconsNeedLinear,H=s.sdfIcons||t.options.rotating||t.options.zooming||W||R?T.LINEAR:T.NEAREST,X=s.sdfIcons&&0!==r.paint.get("icon-halo-width").constantOr(1),Y=t.terrain&&A&&i?e.ae.invert(e.ae.create(),k):Er;if(i&&s.icon){const e=E.elevation,i=e?e.getAtTileOffsetFunc(o,E.center.lat,E.worldSize,s.getProjection()):null,r=Jt(f,n.tileID.canonical,A,S,E,s.getProjection(),m);ii(s,f,t,!1,r,N,A,_,i,o)}return{program:w,buffers:s.icon,uniformValues:M,atlasTexture:Z,atlasTextureIcon:null,atlasInterpolation:H,atlasInterpolationIcon:null,isSDF:s.sdfIcons,hasHalo:X,tile:n,labelPlaneMatrixInv:Y}},V=()=>{const i=M&&"point"!==r.layout.get("symbol-placement"),a=[],l=i||R||z;t.terrainRenderModeElevated()&&I&&a.push("PITCH_WITH_MAP_TERRAIN"),d&&(a.push("PROJECTION_GLOBE_VIEW"),l&&a.push("PROJECTED_POS_ON_VIEWPORT")),s.text.zOffsetVertexBuffer&&a.push("Z_OFFSET"),F(a);const h=s.text.programConfigurations.get(r.id),_=t.getOrCreateProgram(s.iconsInText?"symbolTextAndIcon":"symbolSDF",{config:h,defines:a});let y,x=[0,0],v=null;const b=s.textSizeData;s.iconsInText&&(x=n.imageAtlasTexture?n.imageAtlasTexture.size:[0,0],v=n.imageAtlasTexture?n.imageAtlasTexture:null,y=I||0!==E.pitch||t.options.rotating||t.options.zooming||"composite"===b.kind||"camera"===b.kind?T.LINEAR:T.NEAREST);const w=n.glyphAtlasTexture?n.glyphAtlasTexture.size:[0,0],S=e.aE(b,E.zoom),A=Yt(f,n.tileID.canonical,I,M,E,s.getProjection(),m),C=Kt(f,n.tileID.canonical,I,M,E,s.getProjection(),m),P=t.translatePosMatrix(C,n,c,u,!0),k=t.translatePosMatrix(f,n,c,u),N=l?Er:A,V=M&&!I&&!i;let U=O;!L&&!E.mercatorFromTransition||M||(U=Sr(E));const j=d?U:O;let $;$=s.iconsInText?dr(b.kind,S,V,I,t,k,N,P,w,x,o,p,D,B,j,s.getProjection()):ur(b.kind,S,V,I,t,k,N,P,!0,w,!0,o,p,D,B,j,s.getProjection());const G=n.glyphAtlasTexture?n.glyphAtlasTexture:null,q=T.LINEAR,Z=0!==r.paint.get("text-halo-width").constantOr(1),W=t.terrain&&I&&i?e.ae.invert(e.ae.create(),A):Er;if(i&&s.text){const e=E.elevation,i=e?e.getAtTileOffsetFunc(o,E.center.lat,E.worldSize,s.getProjection()):null,r=Jt(f,n.tileID.canonical,I,M,E,s.getProjection(),m);ii(s,f,t,!0,r,C,I,g,i,o)}return{program:_,buffers:s.text,uniformValues:$,atlasTexture:G,atlasTextureIcon:v,atlasInterpolation:q,atlasInterpolationIcon:y,isSDF:!0,hasHalo:Z,tile:n,labelPlaneMatrixInv:W}},U=s.icon.segments.get().length,j=s.text.segments.get().length,$=U&&!a.onlyText?N():null,G=j&&!a.onlyIcons?V():null,q=r.paint.get("icon-opacity").constantOr(1),Z=r.paint.get("text-opacity").constantOr(1);if(C&&s.canOverlap){P=!0;const t=q&&!a.onlyText?s.icon.segments.get():[],i=Z&&!a.onlyIcons?s.text.segments.get():[];for(const i of t)k.push({segments:new e.b([i]),sortKey:i.sortKey,state:$});for(const t of i)k.push({segments:new e.b([t]),sortKey:t.sortKey,state:G})}else a.onlyText||k.push({segments:q?s.icon.segments:new e.b([]),sortKey:0,state:$}),a.onlyIcons||k.push({segments:Z?s.text.segments:new e.b([]),sortKey:0,state:G})}P&&k.sort(((e,t)=>e.sortKey-t.sortKey));for(const e of k){const i=e.state;if(i)if(t.terrain?t.terrain.setupElevationDraw(i.tile,i.program,{useDepthForOcclusion:E.depthOcclusionForSymbolsAndCircles,labelPlaneMatrixInv:i.labelPlaneMatrixInv}):t.setupDepthForOcclusion(E.depthOcclusionForSymbolsAndCircles,i.program),w.activeTexture.set(T.TEXTURE0),i.atlasTexture&&i.atlasTexture.bind(i.atlasInterpolation,T.CLAMP_TO_EDGE,!0),i.atlasTextureIcon&&(w.activeTexture.set(T.TEXTURE1),i.atlasTextureIcon&&i.atlasTextureIcon.bind(i.atlasInterpolationIcon,T.CLAMP_TO_EDGE,!0)),t.uploadCommonLightUniforms(t.context,i.program),i.hasHalo){const n=i.uniformValues;n.u_is_halo=1,Cr(i.buffers,e.segments,r,t,i.program,z,o,s,n,2),n.u_is_halo=0}else{if(i.isSDF){const n=i.uniformValues;i.hasHalo&&(n.u_is_halo=1,Cr(i.buffers,e.segments,r,t,i.program,z,o,s,n,1)),n.u_is_halo=0}Cr(i.buffers,e.segments,r,t,i.program,z,o,s,i.uniformValues,1)}}}function Cr(t,i,r,n,o,s,a,l,c,h){const u=[t.dynamicLayoutVertexBuffer,t.opacityVertexBuffer,t.iconTransitioningVertexBuffer,t.globeExtVertexBuffer,t.zOffsetVertexBuffer];o.draw(n,n.context.gl.TRIANGLES,s,a,l,e.ag.disabled,c,r.id,t.layoutVertexBuffer,t.indexBuffer,i,r.paint,n.transform.zoom,t.programConfigurations.get(r.id),u,h)}function Pr(t,i,r,n,o,s,a){const l=t.context.gl,c=r.paint.get("fill-pattern"),h=c&&c.constantOr(1);let u,d,p,f,m;a?(d=h&&!r.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",u=l.LINES):(d=h?"fillPattern":"fill",u=l.TRIANGLES);for(const _ of n){const n=i.getTile(_);if(h&&!n.patternsLoaded())continue;const g=n.getBucket(r);if(!g)continue;t.prepareDrawTile();const y=g.programConfigurations.get(r.id),x=t.isTileAffectedByFog(_),v=t.getOrCreateProgram(d,{config:y,overrideFog:x});h&&(t.context.activeTexture.set(l.TEXTURE0),n.imageAtlasTexture&&n.imageAtlasTexture.bind(l.LINEAR,l.CLAMP_TO_EDGE),y.updatePaintBuffers());const b=c.constantOr(null);if(b&&n.imageAtlas){const e=n.imageAtlas.patternPositions[b.toString()];e&&y.setConstantPatternPositions(e)}const w=t.translatePosMatrix(_.projMatrix,n,r.paint.get("fill-translate"),r.paint.get("fill-translate-anchor")),T=r.paint.get("fill-emissive-strength");if(a){f=g.indexBuffer2,m=g.segments2;const e=t.terrain&&t.terrain.renderingToTexture?t.terrain.drapeBufferSize:[l.drawingBufferWidth,l.drawingBufferHeight];p="fillOutlinePattern"===d&&h?Yi(w,T,t,n,e):Xi(w,T,e)}else f=g.indexBuffer,m=g.segments,p=h?Hi(w,T,t,n):Wi(w,T);t.uploadCommonUniforms(t.context,v,_.toUnwrapped()),v.draw(t,u,o,t.stencilModeForClipping(_),s,e.ag.disabled,p,r.id,g.layoutVertexBuffer,f,m,r.paint,t.transform.zoom,y,void 0)}}function zr(t,i,r,n,o,s,a,l){r.resetLayerRenderingStats(t);const c=t.context,h=c.gl,u=t.transform,d=r.paint.get("fill-extrusion-pattern"),p=d.constantOr(1),f=r.paint.get("fill-extrusion-opacity"),m=t.style.enable3dLights(),_=r.paint.get(m&&!p?"fill-extrusion-ambient-occlusion-wall-radius":"fill-extrusion-ambient-occlusion-radius"),g=[r.paint.get("fill-extrusion-ambient-occlusion-intensity"),_],y=r.layout.get("fill-extrusion-edge-radius"),x=y>0&&!r.paint.get("fill-extrusion-rounded-roof"),v=x?0:y,b="globe"===u.projection.name?e.b_():0,w="globe"===u.projection.name,T=w?e.a2(u.zoom):0,E=[e.ak(u.center.lng),e.al(u.center.lat)],S=r.paint.get("fill-extrusion-flood-light-color").toRenderColor(r.lut).toArray01().slice(0,3),M=r.paint.get("fill-extrusion-flood-light-intensity"),A=r.paint.get("fill-extrusion-vertical-scale"),I=0!==r.paint.get("fill-extrusion-line-width").constantOr(1),C=mi(t,r.paint.get("fill-extrusion-cutoff-fade-range")),P=r.paint.get("fill-extrusion-emissive-strength"),z=[];w&&z.push("PROJECTION_GLOBE_VIEW"),g[0]>0&&z.push("FAUX_AO"),x&&z.push("ZERO_ROOF_RADIUS"),l&&z.push("HAS_CENTROID"),M>0&&z.push("FLOOD_LIGHT"),C.shouldRenderCutoff&&z.push("RENDER_CUTOFF"),I&&z.push("RENDER_WALL_MODE");const D=(()=>{const t=r.paint.get("fill-extrusion-line-alignment");switch(t){case"inside":return 1;case"outside":return-1;case"center":return 0;default:return e.w(`Unsupported value for fill-extrusion-line-alignment: ${t}`),0}})();let R;const L="shadow"===t.renderPass,k=t.shadowRenderer,O=L&&!!k;t.shadowRenderer&&(t.shadowRenderer.useNormalOffset=!0);let B=[0,0,0];if(k){const e=t.style.directionalLight,i=t.style.ambientLight;e&&i&&(B=wi(t.style,e,i)),R=z.concat(["SHADOWS_SINGLE_CASCADE"])}const F=O?"fillExtrusionDepth":p?"fillExtrusionPattern":"fillExtrusion",N=r.getLayerRenderingStats();for(const m of n){const n=i.getTile(m),_=n.getBucket(r);if(!_||_.projection.name!==u.projection.name)continue;let y=!1;k&&(y=0===k.getMaxCascadeForTile(m.toUnwrapped()));const x=t.isTileAffectedByFog(m),O=_.programConfigurations.get(r.id),V=t.getOrCreateProgram(F,{config:O,defines:y?R:z,overrideFog:x});if(t.terrain&&t.terrain.setupElevationDraw(n,V,{useMeterToDem:!0}),!_.centroidVertexBuffer){const e=V.attributes.a_centroid_pos;void 0!==e&&h.vertexAttrib2f(e,0,0)}!L&&k&&k.setupShadows(n.tileID.toUnwrapped(),V,"vector-tile",n.tileID.overscaledZ),p&&(t.context.activeTexture.set(h.TEXTURE0),n.imageAtlasTexture&&n.imageAtlasTexture.bind(h.LINEAR,h.CLAMP_TO_EDGE),O.updatePaintBuffers());const U=d.constantOr(null);if(U&&n.imageAtlas){const e=n.imageAtlas.patternPositions[U.toString()];e&&O.setConstantPatternPositions(e)}const j=r.paint.get("fill-extrusion-vertical-gradient"),$=1/_.tileToMeter;let G;if(L&&k){if(Br(n.tileID,_,t))continue;const e=k.calculateShadowPassMatrixFromTile(n.tileID.toUnwrapped());G=qi(e,v,D,$,A)}else{const e=t.translatePosMatrix(m.expandedProjMatrix,n,r.paint.get("fill-extrusion-translate"),r.paint.get("fill-extrusion-translate-anchor")),i=u.projection.createInversionMatrix(u,m.canonical);G=p?Zi(e,t,j,f,g,v,D,$,m,n,b,T,E,i,S,A):Gi(e,t,j,f,g,v,D,$,m,b,T,E,i,S,A,M,B,P)}t.uploadCommonUniforms(c,V,m.toUnwrapped(),null,C);let q=_.segments;if("mercator"===u.projection.name&&!L&&(q=_.getVisibleSegments(n.tileID,t.terrain,t.transform.getFrustum(0)),!q.get().length))continue;if(N)if(L)for(const e of q.get())N.numRenderedVerticesInShadowPass+=e.primitiveLength;else for(const e of q.get())N.numRenderedVerticesInTransparentPass+=e.primitiveLength;const Z=[];(t.terrain||l)&&Z.push(_.centroidVertexBuffer),w&&Z.push(_.layoutVertexExtBuffer),I&&Z.push(_.wallVertexBuffer),V.draw(t,c.gl.TRIANGLES,o,s,a,e.ag.backCCW,G,r.id,_.layoutVertexBuffer,_.indexBuffer,q,r.paint,t.transform.zoom,O,Z)}t.shadowRenderer&&(t.shadowRenderer.useNormalOffset=!1)}function Dr(t,i,r,n,o,s,a,l,c,h,u,d,p,f,m,_,g,y,x){const v=t.context,b=v.gl,w=t.transform,T=t.transform.zoom,E=[],S=mi(t,r.paint.get("fill-extrusion-cutoff-fade-range"));"clear"===h?(E.push("CLEAR_SUBPASS"),x&&(E.push("CLEAR_FROM_TEXTURE"),v.activeTexture.set(b.TEXTURE0),x.bind(b.LINEAR,b.CLAMP_TO_EDGE))):"sdf"===h&&E.push("SDF_SUBPASS"),g&&E.push("HAS_CENTROID"),S.shouldRenderCutoff&&E.push("RENDER_CUTOFF");const M=r.layout.get("fill-extrusion-edge-radius"),A=(e,i,n,h,y)=>{const b=i.programConfigurations.get(r.id),w=t.isTileAffectedByFog(e),A=t.getOrCreateProgram("fillExtrusionGroundEffect",{config:b,defines:E,overrideFog:w}),I=((e,t,i,r,n,o,s,a,l,c,h)=>({u_matrix:t,u_opacity:i,u_ao_pass:r?1:0,u_meter_to_tile:n,u_ao:o,u_flood_light_intensity:s,u_flood_light_color:a,u_attenuation:l,u_edge_radius:c,u_fb:0,u_fb_size:h}))(0,h,u,c,y,[d,p*y],f,m,_,T>=17?0:M*y,x?x.size[0]:0),C=[];g&&C.push(i.hiddenByLandmarkVertexBuffer),t.uploadCommonUniforms(v,A,e.toUnwrapped(),null,S),A.draw(t,v.gl.TRIANGLES,o,s,a,l,I,r.id,i.vertexBuffer,i.indexBuffer,n,r.paint,T,b,C)};for(const o of n){const n=i.getTile(o),s=n.getBucket(r);if(!s||s.projection.name!==w.projection.name||!s.groundEffect||s.groundEffect&&!s.groundEffect.hasData())continue;const a=s.groundEffect,l=1/s.tileToMeter;{const e=t.translatePosMatrix(o.projMatrix,n,r.paint.get("fill-extrusion-translate"),r.paint.get("fill-extrusion-translate-anchor")),i=a.getDefaultSegment();A(o,a,i,e,l)}if(y)for(let s=0;s<4;s++){const a=e.b$[s](o),c=i.getTile(a);if(!c)continue;const h=c.getBucket(r);if(!h||h.projection.name!==w.projection.name||!h.groundEffect||h.groundEffect&&!h.groundEffect.hasData())continue;const u=h.groundEffect;let d,p;0===s?(d=[-e.a4,0,0],p=1):1===s?(d=[e.a4,0,0],p=0):2===s?(d=[0,-e.a4,0],p=3):(d=[0,e.a4,0],p=2);const f=u.regionSegments[p];if(!f)continue;const m=new Float32Array(16);e.ae.translate(m,o.projMatrix,d),A(o,u,f,t.translatePosMatrix(m,n,r.paint.get("fill-extrusion-translate"),r.paint.get("fill-extrusion-translate-anchor")),l)}}}function Rr(t,i,r,n,o,s,a){0===n.centroidVertexArray.length&&n.createCentroidsBuffer();const l=s?s.findDEMTileFor(r):null;if(!(l&&l.dem||a))return;const c=t=>new e.P(Math.ceil((t+e.c2)*e.c3),0),h=e=>{const t=i.getSource().minzoom,r=e=>{const t=i.getTileByID(e);if(t&&t.hasData())return t.getBucket(o)},n=[0,-1,1];for(const i of n){if(e.overscaledZ+i(u[0]=Math.min(t.min.y,i.min.y),u[1]=Math.max(t.max.y,i.max.y),u[2]=e.a4-i.min.x>t.max.x?i.min.x-e.a4:t.max.x,u),p=(t,i)=>(u[0]=Math.min(t.min.x,i.min.x),u[1]=Math.max(t.max.x,i.max.x),u[2]=e.a4-i.min.y>t.max.y?i.min.y-e.a4:t.max.y,u),f=[(e,t)=>d(e,t),(e,t)=>d(t,e),(e,t)=>p(e,t),(e,t)=>p(t,e)],m=(t,i,n,o,a,c,h)=>{if(!s)return 0;const u=[[c?n:t,c?t:n,0],[c?n:i,c?i:n,0]],d=h<0?e.a4+h:h,p=[c?d:(t+i)/2,c?(t+i)/2:d,0];return 0===n&&h<0||0!==n&&h>0?s.getForTilePoints(a,[p],!0,o):u.push(p),s.getForTilePoints(r,u,!0,l),Math.max(u[0][2],u[1][2],p[2])/s.exaggeration()};for(let t=0;t<4;t++){const i=n.borderFeatureIndices[t];if(0===i.length)continue;const o=e.b$[t](r),l=h(o);if(!(l&&l instanceof e.c0))continue;if(n.borderDoneWithNeighborZ[t]===l.canonical.z)continue;0===l.centroidVertexArray.length&&l.createCentroidsBuffer();const u=s?s.findDEMTileFor(o):null;if(!(u&&u.dem||a))continue;const d=(t<2?1:5)-t,p=l.borderDoneWithNeighborZ[d]!==n.canonical.z,y=l.borderFeatureIndices[d];let x=0;if(n.canonical.z!==l.canonical.z){for(const e of i)n.showCentroid(n.featuresOnBorder[e]);if(p)for(const e of y)l.showCentroid(l.featuresOnBorder[e]);n.borderDoneWithNeighborZ[t]=l.canonical.z,l.borderDoneWithNeighborZ[d]=n.canonical.z}for(const r of i){const i=n.featuresOnBorder[r],s=n.centroidData[i.centroidDataIndex],h=i.borders[t];let p;for(;xh[0]+3||e[0]>h[0]-3)break;l.showCentroid(p),x++}if(p&&xh[1]-3)&&(v++,++x!==y.length);)p=l.featuresOnBorder[y[x]];if(p=l.featuresOnBorder[y[r]],v>1){const e=p.borders[d];Math.abs(h[0]-e[0])<3&&Math.abs(h[1]-e[1])<3&&(v=1,x=r+1)}else if(0===v){n.showCentroid(i);continue}const b=l.centroidData[p.centroidDataIndex];a&&1===v&&(((_=s).flags|(g=b).flags)&e.c1?(_.flags|=e.c1,g.flags|=e.c1):(_.flags&=~e.c1,g.flags&=~e.c1));const w=i.intersectsCount()>1||p.intersectsCount()>1;if(v>1)x=r,s.centroidXY=b.centroidXY=new e.P(0,0);else if(u&&u.dem&&!w){const i=f[t](s,b),r=t%2?e.a4-1:0,n=m(i[0],Math.min(e.a4-1,i[1]),r,u,o,t<2,i[2]);s.centroidXY=b.centroidXY=c(n)}else w?s.centroidXY=b.centroidXY=new e.P(0,0):(s.centroidXY=n.encodeBorderCentroid(i),b.centroidXY=l.encodeBorderCentroid(p));n.writeCentroidToBuffer(s),l.writeCentroidToBuffer(b)}else n.showCentroid(i)}n.borderDoneWithNeighborZ[t]=l.canonical.z,l.borderDoneWithNeighborZ[d]=n.canonical.z}var _,g;(n.needsCentroidUpdate||!n.centroidVertexBuffer&&0!==n.centroidVertexArray.length)&&n.uploadCentroid(t)}const Lr=[1,0,0],kr=[0,1,0],Or=[0,0,1];function Br(t,i,r){const n=r.transform,o=r.shadowRenderer;if(!o)return!0;const s=t.toUnwrapped(),a=n.tileSize*o._cascades[r.currentShadowCascade].scale;let l=i.maxHeight;if(n.elevation){const e=n.elevation.getMinMaxForTile(t);e&&(l+=e.max)}const c=[...o.shadowDirection];c[2]=-c[2];const h=o.computeSimplifiedTileShadowVolume(s,l,a,c);if(!h)return!1;const u=[Lr,kr,Or,c,[c[0],0,c[2]],[0,c[1],c[2]]],d="globe"===n.projection.name,p=n.scaleZoom(a),f=e.aM.fromInvProjectionMatrix(n.invProjMatrix,n.worldSize,p,!d),m=o.getCurrentCascadeFrustum();return 0===f.intersectsPrecise(h.vertices,h.planes,u)||0===m.intersectsPrecise(h.vertices,h.planes,u)}function Fr(t){return[t[0]*e.c4,t[1]*e.c4,t[2]*e.c4,0]}function Nr(t,i,r,n,o,s,a,l,c){const h=n.getSource(),u=r.globeSharedBuffers;if(!u)return;let d,p,f;if(i&&(d=n.getTile(i)),h instanceof e.bo?(p=h.texture,f=e.bj(0,0,r.transform)):d&&i&&(p=d.texture,f=e.bj(i.canonical.z,i.canonical.x,r.transform)),!p||!f)return;t||(f=e.ae.scale(e.ae.create(),f,[1,-1,1]));const m=r.context,_=m.gl,g="nearest"===o.paint.get("raster-resampling")?_.NEAREST:_.LINEAR,y=r.colorModeForDrapableLayerRenderPass(s),x=a.defines;x.push("GLOBE_POLES");const v=new e.af(_.LEQUAL,e.af.ReadWrite,r.depthRangeFor3D),b=Float32Array.from(r.transform.expandedFarZProjMatrix),w=Float32Array.from(e.bh(e.bi(new e.aO(0,0,0))));r.terrain&&r.terrain.prepareDrawTile(),m.activeTexture.set(_.TEXTURE0),p.bind(g,_.CLAMP_TO_EDGE),m.activeTexture.set(_.TEXTURE1),p.bind(g,_.CLAMP_TO_EDGE),p.useMipmap&&m.extTextureFilterAnisotropic&&r.transform.pitch>20&&_.texParameterf(_.TEXTURE_2D,m.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,m.extTextureFilterAnisotropicMax);const[T,E,S,M]=i?u.getPoleBuffers(i.canonical.z,!1):u.getPoleBuffers(0,!0),A=o.paint.get("raster-elevation");let I;t?(I=T,r.renderDefaultNorthPole=0!==A):(I=E,r.renderDefaultSouthPole=0!==A);const C=Fr(a.mix),P=((e,t,i,r,n,o,s,a,l,c,h,u,d)=>rr(e,t,i,new Float32Array(16),new Float32Array(9),[0,0],r,[0,0],[0,0,0,0],1,{opacity:1,mix:0},o,[0,0],a,2,c,h,u,1,0,d))(b,w,f,e.a2(r.transform.zoom),0,o,0,A,0,C,a.offset,a.range,s),z=r.getOrCreateProgram("raster",{defines:x});r.uploadCommonUniforms(m,z,null),z.draw(r,_.TRIANGLES,v,c,y,l,P,o.id,I,S,M)}function Vr(e){const t=e._nearZ,i=e.projection.farthestPixelDistance(e),r=i-t,n=.2*e.height,o=t+n;return[t,i,(o-n-t)/r,(o-t)/r]}function Ur(t,i,r,n){if(t)return i instanceof zi&&t instanceof e.c5?i.getTextureDescriptor(t,r,!0):{texture:t.texture,mix:Fr(n.mix),offset:n.offset,buffer:0,tileSize:1}}function jr(t,i,r){if(!t)return null;const n=i.getTextureDescriptor(t,r,!0);if(!n)return null;let{texture:o,mix:s,offset:a,tileSize:l,buffer:c,format:h}=n;if(!o||!h)return null;let u=!1;return"uint32"===h&&(u=!0,s[3]=0,s=tr(e.c6,s,[0,r.paint.get("raster-particle-max-speed")]),a=ir(e.c6,a,[0,r.paint.get("raster-particle-max-speed")])),{texture:o,textureOffset:[c/(l+2*c),l/(l+2*c)],tileSize:l,scalarData:u,scale:s,offset:a,defines:["RASTER_ARRAY",{uint8:"DATA_FORMAT_UINT8",uint16:"DATA_FORMAT_UINT16",uint32:"DATA_FORMAT_UINT32"}[h]]}}function $r(e){const t=e._nearZ,i=e.projection.farthestPixelDistance(e),r=i-t,n=.2*e.height,o=t+n;return[t,i,(o-n-t)/r,(o-t)/r]}const Gr=new e.C(1,0,0,1),qr=new e.C(0,1,0,1),Zr=new e.C(0,0,1,1),Wr=new e.C(1,0,1,1),Hr=new e.C(0,1,1,1);function Xr(t,i,r,n,o,s,a){const l=t.context,c=t.transform,h=l.gl,u="globe"===c.projection.name,d=u?["PROJECTION_GLOBE_VIEW"]:[];let p=e.ae.clone(r.projMatrix);if(u&&e.a2(c.zoom)>0){const t=e.c7(r.canonical,c),i=e.c8(t);p=e.ae.multiply(new Float32Array(16),c.globeMatrix,i),e.ae.multiply(p,c.projMatrix,p)}const f=e.ae.create();f[12]+=2*o/(e.e.devicePixelRatio*c.width),f[13]+=2*s/(e.e.devicePixelRatio*c.height),e.ae.multiply(p,f,p);const m=t.getOrCreateProgram("debug",{defines:d}),_=i.getTileByID(r.key);t.terrain&&t.terrain.setupElevationDraw(_,m);const g=e.af.disabled,y=e.ah.disabled,x=t.colorModeForRenderPass(),v="$debug";l.activeTexture.set(h.TEXTURE0),t.emptyTexture.bind(h.LINEAR,h.CLAMP_TO_EDGE),u?_._makeGlobeTileDebugBuffers(t.context,c):_._makeDebugTileBoundsBuffers(t.context,c.projection);const b=_._tileDebugBuffer||t.debugBuffer,w=_._tileDebugIndexBuffer||t.debugIndexBuffer,T=_._tileDebugSegments||t.debugSegments;if(m.draw(t,h.LINE_STRIP,g,y,x,e.ag.disabled,Ki(p,n),v,b,w,T,null,null,null,[_._globeTileDebugBorderBuffer]),a){const e=_.latestRawTileData,i=Math.floor((e&&e.byteLength||0)/1024);let n=r.canonical.toString();r.overscaledZ!==r.canonical.z&&(n+=` => ${r.overscaledZ}`),n+=` ${_.state}`,n+=` ${i}kb`,(function(e,t){e.initDebugOverlayCanvas();const i=e.debugOverlayCanvas,r=e.context.gl,n=e.debugOverlayCanvas.getContext("2d");n.clearRect(0,0,i.width,i.height),n.shadowColor="white",n.shadowBlur=2,n.lineWidth=1.5,n.strokeStyle="white",n.textBaseline="top",n.font="bold 36px Open Sans, sans-serif",n.fillText(t,5,5),n.strokeText(t,5,5),e.debugOverlayTexture.update(i),e.debugOverlayTexture.bind(r.LINEAR,r.CLAMP_TO_EDGE)})(t,n)}const E=i.getTile(r).tileSize,S=512/Math.min(E,512)*(r.overscaledZ/c.zoom)*.5,M=_._tileDebugTextBuffer||t.debugBuffer,A=_._tileDebugTextIndexBuffer||t.quadTriangleIndexBuffer,I=_._tileDebugTextSegments||t.debugSegments;m.draw(t,h.TRIANGLES,g,y,e.a.alphaBlended,e.ag.disabled,Ki(p,e.C.transparent,S),v,M,A,I,null,null,null,[_._globeTileDebugTextBuffer])}function Yr(e,t,i,r){Kr(e,0,t+i/2,e.transform.width,i,r)}function Jr(e,t,i,r){Kr(e,t-i/2,0,i,e.transform.height,r)}function Kr(t,i,r,n,o,s){const a=t.context,l=a.gl;l.enable(l.SCISSOR_TEST),l.scissor(i*e.e.devicePixelRatio,r*e.e.devicePixelRatio,n*e.e.devicePixelRatio,o*e.e.devicePixelRatio),a.clear({color:s}),l.disable(l.SCISSOR_TEST)}const Qr=e.c9([{name:"a_pos_3f",components:3,type:"Float32"}]),{members:en}=Qr;function tn(e,t,i,r){e.emplaceBack(t,i,r)}class rn{constructor(t){this.vertexArray=new e.ca,this.indices=new e.bw,tn(this.vertexArray,-1,-1,1),tn(this.vertexArray,1,-1,1),tn(this.vertexArray,-1,1,1),tn(this.vertexArray,1,1,1),tn(this.vertexArray,-1,-1,-1),tn(this.vertexArray,1,-1,-1),tn(this.vertexArray,-1,1,-1),tn(this.vertexArray,1,1,-1),this.indices.emplaceBack(5,1,3),this.indices.emplaceBack(3,7,5),this.indices.emplaceBack(6,2,0),this.indices.emplaceBack(0,4,6),this.indices.emplaceBack(2,6,7),this.indices.emplaceBack(7,3,2),this.indices.emplaceBack(5,4,0),this.indices.emplaceBack(0,1,5),this.indices.emplaceBack(0,2,3),this.indices.emplaceBack(3,1,0),this.indices.emplaceBack(7,6,4),this.indices.emplaceBack(4,5,7),this.vertexBuffer=t.createVertexBuffer(this.vertexArray,en),this.indexBuffer=t.createIndexBuffer(this.indices),this.segment=e.b.simpleSegment(0,0,36,12)}}function nn(t,i,r,n,o,s){const a=t.context.gl,l=i.paint.get("sky-atmosphere-color"),c=i.paint.get("sky-atmosphere-halo-color"),h=i.paint.get("sky-atmosphere-sun-intensity"),u=((e,t,i,r,n)=>({u_matrix_3f:e,u_sun_direction:t,u_sun_intensity:i,u_color_tint_r:[r.r,r.g,r.b,r.a],u_color_tint_m:[n.r,n.g,n.b,n.a],u_luminance:5e-5}))(e.bE.fromMat4(e.bE.create(),n),o,h,l,c);a.framebufferTexture2D(a.FRAMEBUFFER,a.COLOR_ATTACHMENT0,a.TEXTURE_CUBE_MAP_POSITIVE_X+s,i.skyboxTexture,0),r.draw(t,a.TRIANGLES,e.af.disabled,e.ah.disabled,e.a.unblended,e.ag.frontCW,u,"skyboxCapture",i.skyboxGeometry.vertexBuffer,i.skyboxGeometry.indexBuffer,i.skyboxGeometry.segment)}const on=e.c9([{type:"Float32",name:"a_pos",components:3},{type:"Float32",name:"a_uv",components:2}]);class sn{constructor(t){const i=new e.cb;i.emplaceBack(-1,1,1,0,0),i.emplaceBack(1,1,1,1,0),i.emplaceBack(1,-1,1,1,1),i.emplaceBack(-1,-1,1,0,1);const r=new e.bw;r.emplaceBack(0,1,2),r.emplaceBack(2,3,0),this.vertexBuffer=t.createVertexBuffer(i,on.members),this.indexBuffer=t.createIndexBuffer(r),this.segments=e.b.simpleSegment(0,0,4,2)}destroy(){this.vertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy()}}const an=e.c9([{type:"Float32",name:"a_pos_3f",components:3},{type:"Float32",name:"a_uv",components:2},{type:"Float32",name:"a_size_scale",components:1},{type:"Float32",name:"a_fade_opacity",components:1}]);class ln{constructor(){this.starsCount=16e3,this.sizeMultiplier=.15,this.sizeRange=100,this.intensityRange=200}}class cn{constructor(t){this.colorModeAlphaBlendedWriteRGB=new e.a([e.cc,e.cd,e.cc,e.cd],e.C.transparent,[!0,!0,!0,!1]),this.colorModeWriteAlpha=new e.a([e.cc,e.ce,e.cc,e.ce],e.C.transparent,[!1,!1,!1,!0]),this.params=new ln,this.updateNeeded=!0,t.tp.registerParameter(this.params,["Stars"],"starsCount",{min:100,max:16e3,step:1},(()=>{this.updateNeeded=!0})),t.tp.registerParameter(this.params,["Stars"],"sizeMultiplier",{min:.01,max:2,step:.01}),t.tp.registerParameter(this.params,["Stars"],"sizeRange",{min:0,max:200,step:1},(()=>{this.updateNeeded=!0})),t.tp.registerParameter(this.params,["Stars"],"intensityRange",{min:0,max:200,step:1},(()=>{this.updateNeeded=!0}))}update(t){const i=t.context;if(!this.atmosphereBuffer||this.updateNeeded){this.updateNeeded=!1,this.atmosphereBuffer=new sn(i);const t=this.params.sizeRange,r=this.params.intensityRange,n=(function(t){const i=e.ch(30),r=[];for(let n=0;n{const l="globe"===o.projection.name?["PROJECTION_GLOBE_VIEW","FOG"]:["FOG"];i&&l.push("ALPHA_PASS");const d=t.getOrCreateProgram("globeAtmosphere",{defines:l}),f=((e,t,i,r,n,o,s,a,l,c,h,u)=>({u_frustum_tl:e,u_frustum_tr:t,u_frustum_br:i,u_frustum_bl:r,u_horizon:n,u_transition:o,u_fadeout_range:s,u_color:a,u_high_color:l,u_space_color:c,u_temporal_offset:h,u_horizon_angle:u}))(o.frustumCorners.TL,o.frustumCorners.TR,o.frustumCorners.BR,o.frustumCorners.BL,o.frustumCorners.horizon,a,p,c,h,u,m,y);t.uploadCommonUniforms(r,d);const _=this.atmosphereBuffer;_&&d.draw(t,n.TRIANGLES,s,e.ah.disabled,i?this.colorModeWriteAlpha:this.colorModeAlphaBlendedWriteRGB,e.ag.backCW,f,i?"atmosphere_glow_alpha":"atmosphere_glow",_.vertexBuffer,_.indexBuffer,_.segments)};x(!1),x(!0)}drawStars(t,i){const r=e.au(i.properties.get("star-intensity"),0,1);if(0===r)return;const n=t.context,o=n.gl,s=t.transform,a=t.getOrCreateProgram("stars"),l=e.aw.identity([]);e.aw.rotateX(l,l,-s._pitch),e.aw.rotateZ(l,l,-s.angle),e.aw.rotateX(l,l,e.ac(s._center.lat)),e.aw.rotateY(l,l,-e.ac(s._center.lng));const c=e.ae.fromQuat(new Float32Array(16),l),h=e.ae.multiply([],s.starsProjMatrix,c),u=e.bE.fromMat4([],c),d=e.bE.invert([],u),p=[0,1,0];e.$.transformMat3(p,p,d),e.$.scale(p,p,this.params.sizeMultiplier);const f=[1,0,0];e.$.transformMat3(f,f,d),e.$.scale(f,f,this.params.sizeMultiplier);const m=(_=p,g=f,y=r,{u_matrix:Float32Array.from(h),u_up:_,u_right:g,u_intensity_multiplier:y});var _,g,y;t.uploadCommonUniforms(n,a),this.starsVx&&this.starsIdx&&a.draw(t,o.TRIANGLES,e.af.disabled,e.ah.disabled,this.colorModeAlphaBlendedWriteRGB,e.ag.disabled,m,"atmosphere_stars",this.starsVx,this.starsIdx,this.starsSegments)}}function hn(t,i){const r=[...t],n=i.cameraWorldSizeForFog/i.worldSize,o=e.ae.identity([]);return e.ae.scale(o,o,[n,n,1]),e.ae.multiply(r,o,r),e.ae.multiply(r,i.worldToFogMatrix,r),r}function un(t,i,r,n,o){const s=r.material,a=n.context,{baseColorTexture:l,metallicRoughnessTexture:c}=s.pbrMetallicRoughness,{normalTexture:h,occlusionTexture:u,emissionTexture:d}=s;function p(e,i,r){if(e&&(t.push(i),a.activeTexture.set(a.gl.TEXTURE0+r),e.gfxTexture)){const{minFilter:t,magFilter:i,wrapS:r,wrapT:n}=e.sampler;e.gfxTexture.bindExtraParam(t,i,r,n)}}p(l,"HAS_TEXTURE_u_baseColorTexture",fi.BaseColor),p(c,"HAS_TEXTURE_u_metallicRoughnessTexture",fi.MetallicRoughness),p(h,"HAS_TEXTURE_u_normalTexture",fi.Normal),p(u,"HAS_TEXTURE_u_occlusionTexture",fi.Occlusion),p(d,"HAS_TEXTURE_u_emissionTexture",fi.Emission),o&&(o.texture||(o.texture=new e.cj(n.context,o.image,[o.image.height,o.image.height,o.image.height],a.gl.RGBA)),a.activeTexture.set(a.gl.TEXTURE0+fi.LUT),o.texture&&o.texture.bind(a.gl.LINEAR,a.gl.CLAMP_TO_EDGE),t.push("APPLY_LUT_ON_GPU")),r.texcoordBuffer&&(t.push("HAS_ATTRIBUTE_a_uv_2f"),i.push(r.texcoordBuffer)),r.colorBuffer&&(t.push(12===r.colorBuffer.itemSize?"HAS_ATTRIBUTE_a_color_3f":"HAS_ATTRIBUTE_a_color_4f"),i.push(r.colorBuffer)),r.normalBuffer&&(t.push("HAS_ATTRIBUTE_a_normal_3f"),i.push(r.normalBuffer)),r.pbrBuffer&&(t.push("HAS_ATTRIBUTE_a_pbr"),t.push("HAS_ATTRIBUTE_a_heightBasedEmissiveStrength"),i.push(r.pbrBuffer)),"OPAQUE"!==s.alphaMode&&"MASK"!==s.alphaMode||t.push("UNPREMULT_TEXTURE_IN_SHADER"),s.defined||t.push("DIFFUSE_SHADED"),t.push("USE_STANDARD_DERIVATIVES")}function dn(t,i,r,n,o,s){const a=r.paint.get("model-opacity"),l=i.context,c=new e.af(i.context.gl.LEQUAL,e.af.ReadWrite,i.depthRangeFor3D),h=i.transform,u=t.mesh,d=u.material,p=d.pbrMetallicRoughness,f=i.style.fog;let m;m="pixels"===i.transform.projection.zAxisUnit?[...t.nodeModelMatrix]:e.ae.multiply([],n.zScaleMatrix,t.nodeModelMatrix),e.ae.multiply(m,n.negCameraPosMatrix,m);const _=e.ae.invert([],m);e.ae.transpose(_,_);const g=r.paint.get("model-emissive-strength").constantOr(0),y=_r(new Float32Array(t.worldViewProjection),new Float32Array(m),new Float32Array(_),null,i,a,p.baseColorFactor.toRenderColor(null),d.emissiveFactor,p.metallicFactor,p.roughnessFactor,d,g,r),x={defines:[]},v=[];un(x.defines,v,u,i,r.lut);const b=i.shadowRenderer;b&&(b.useNormalOffset=!1);let w=null;if(f){const e=hn(t.nodeModelMatrix,i.transform);if(w=new Float32Array(e),"globe"!==h.projection.name){const t=u.aabb.min,i=u.aabb.max,[r,n]=f.getOpacityForBounds(e,t[0],t[1],i[0],i[1]);x.overrideFog=r>=it||n>=it}}const T=mi(i,r.paint.get("model-cutoff-fade-range"));T.shouldRenderCutoff&&x.defines.push("RENDER_CUTOFF");const E=i.getOrCreateProgram("model",x);i.uploadCommonUniforms(l,E,null,w,T),"shadow"!==i.renderPass&&b&&b.setupShadowsFromMatrix(t.nodeModelMatrix,E),E.draw(i,l.gl.TRIANGLES,c,o,s,u.material.doubleSided?e.ag.disabled:e.ag.backCCW,y,r.id,u.vertexBuffer,u.indexBuffer,u.segments,r.paint,i.transform.zoom,void 0,v)}function pn(t,i,r,n,o,s,a){let l;l="globe"===t.projection.name?e.ck(r,t):[...r],e.ae.multiply(l,l,i.matrix);const c=e.ae.multiply([],n,l);if(i.meshes)for(const t of i.meshes){if("BLEND"!==t.material.alphaMode){a.push({mesh:t,depth:0,modelIndex:o,worldViewProjection:c,nodeModelMatrix:l});continue}const i=e.$.transformMat4([],t.centroid,c);i[2]>0&&s.push({mesh:t,depth:i[2],modelIndex:o,worldViewProjection:c,nodeModelMatrix:l})}if(i.children)for(const e of i.children)pn(t,e,r,n,o,s,a)}function fn(t,i,r,n){const o=r.shadowRenderer;if(!o)return;const s=o.getShadowPassDepthMode(),a=o.getShadowPassColorMode(),l=o.calculateShadowPassMatrixFromMatrix(i),c=gr(l);r.getOrCreateProgram("modelDepth",{defines:r._shadowMapDebug?[]:["DEPTH_TEXTURE"]}).draw(r,r.context.gl.TRIANGLES,s,e.ah.disabled,a,e.ag.backCCW,c,n.id,t.vertexBuffer,t.indexBuffer,t.segments,n.paint,r.transform.zoom,void 0,void 0)}function mn(t,i,r){const n=i.updateZoomBasedPaintProperties(),o=(function(t,i,r){let n,o,s,a=t.terrain?t.terrain.exaggeration():0;if(t.terrain&&a>0){const i=t.terrain,o=i.findDEMTileFor(r);o&&o.dem?n=e.cm.create(i,r,o):a=0}if(0===a&&(i.terrainElevationMin=0,i.terrainElevationMax=0),a===i.validForExaggeration&&(0===a||n&&n._demTile&&n._demTile.tileID===i.validForDEMTile.id&&n._dem._timestamp===i.validForDEMTile.timestamp))return!1;for(const e in i.instancesPerModel){const t=i.instancesPerModel[e];for(let e=0;eh&&(h=e.max)}const u=e.au(n.x,s,a)-n.x,d=e.au(n.y,l,c)-n.y,p=e.ay(h,i.center.lat)-n.z;return i._zoomFromMercatorZ(Math.sqrt(u*u+d*d+p*p))}function yn(t,i,r,n,o,s,a){const l=t.context,c="shadow"===t.renderPass,h=t.shadowRenderer,u=c&&h?h.getShadowPassDepthMode():new e.af(l.gl.LEQUAL,e.af.ReadWrite,t.depthRangeFor3D),d=t.isTileAffectedByFog(s);if(r.meshes)for(const p of r.meshes){const f=["MODEL_POSITION_ON_GPU"],m=[];let _,g,y;n.instancedDataArray.length>20&&f.push("INSTANCED_ARRAYS");const x=mi(t,i.paint.get("model-cutoff-fade-range"));if(x.shouldRenderCutoff&&f.push("RENDER_CUTOFF"),c&&h)_=t.getOrCreateProgram("modelDepth",{defines:f}),g=gr(a.shadowTileMatrix,a.shadowTileMatrix,Float32Array.from(r.matrix)),y=h.getShadowPassColorMode();else{un(f,m,p,t,i.lut),_=t.getOrCreateProgram("model",{defines:f,overrideFog:d});const n=p.material,c=n.pbrMetallicRoughness,u=i.paint.get("model-opacity"),v=i.paint.get("model-emissive-strength").constantOr(0);g=_r(s.expandedProjMatrix,Float32Array.from(r.matrix),new Float32Array(16),null,t,u,c.baseColorFactor.toRenderColor(null),n.emissiveFactor,c.metallicFactor,c.roughnessFactor,n,v,i,o),h&&(a.shadowUniformsInitialized?_.setShadowUniformValues(l,h.getShadowUniformValues()):(h.setupShadows(s.toUnwrapped(),_,"model-tile",s.overscaledZ),a.shadowUniformsInitialized=!0)),y=x.shouldRenderCutoff||u<1||"OPAQUE"!==n.alphaMode?e.a.alphaBlended:e.a.unblended}t.uploadCommonUniforms(l,_,s.toUnwrapped(),null,x);const v=p.material.doubleSided?e.ag.disabled:e.ag.backCCW;if(n.instancedDataArray.length>20)m.push(n.instancedDataBuffer),_.draw(t,l.gl.TRIANGLES,u,e.ah.disabled,y,v,g,i.id,p.vertexBuffer,p.indexBuffer,p.segments,i.paint,t.transform.zoom,void 0,m,n.instancedDataArray.length);else{const r=c?"u_instance":"u_normal_matrix";for(let o=0;oh[1]?l:h,a[0]=r.max[0],l=e.aB.transformMat4([],a,s),c=l[1]h[1]?l:h,a[1]=r.min[1],l=e.aB.transformMat4([],a,s),c=l[1]h[1]?l:h;const u=e.au(n[0],0,1),d=100*i.pixelsPerMeter*e.au(n[1],0,1),p=e.au(n[2],0,1),f=e.$.lerp([],c,h,u),m=Math.tan(.5*i.fovX),_=-f[2]*m;if(0===d)return f[1]<-Math.abs(_)?p:1;const g=(-Math.abs(_)-f[1])/d,y=(e,t,i)=>(1-i)*e+i*t,x=e.au(y(1,p,g),p,1);return y(1,x,e.au((i.pitch-20)/20,0,1))}class Tn{}class En{constructor(){this._storage=new Map}getLinesFromTrianglesBuffer(t,i,r){{const e=this._storage.get(i.id);if(e)return e.lastUsedFrameIdx=t,e.buf}const n=r.gl,o=n.getBufferParameter(n.ELEMENT_ARRAY_BUFFER,n.BUFFER_SIZE),s=new ArrayBuffer(o),a=new Int16Array(s);n.getBufferSubData(n.ELEMENT_ARRAY_BUFFER,0,new Int16Array(s));const l=new e.co;for(let e=0;e30&&(i.buf.destroy(),this._storage.delete(t))}destroy(){for(const[e,t]of this._storage)t.buf.destroy(),this._storage.delete(e)}}class Sn{constructor(e){this.occluderSize=30,this.depthOffset=-1e-4,e.registerParameter(this,["Occlusion"],"occluderSize",{min:1,max:100,step:1}),e.registerParameter(this,["Occlusion"],"depthOffset",{min:-.05,max:0,step:1e-5})}}const Mn={symbol:function(t,i,r,n,o){if("translucent"!==t.renderPass)return;const s=e.ah.disabled,a=t.colorModeForRenderPass();r.layout.get("text-variable-anchor")&&(function(t,i,r,n,o,s,a){const l=i.transform,c="map"===o,h="map"===s;for(const i of t){const t=n.getTile(i),o=t.getBucket(r);if(!o||!o.text||!o.text.segments.get().length)continue;const s=e.aE(o.textSizeData,l.zoom),u=br(i,o.getProjection(),l),d=l.calculatePixelsToTileUnitsMatrix(t),p=Yt(u,t.tileID.canonical,h,c,l,o.getProjection(),d),f=o.hasIconTextFit()&&o.hasIconData();if(s){const r=Math.pow(2,l.zoom-t.tileID.overscaledZ);Ar(o,c,h,a,e.bQ,l,p,i,r,s,f)}}})(n,t,r,i,r.layout.get("text-rotation-alignment"),r.layout.get("text-pitch-alignment"),o);const l=0!==r.paint.get("icon-opacity").constantOr(1),c=0!==r.paint.get("text-opacity").constantOr(1);void 0!==r.layout.get("symbol-sort-key").constantOr(1)&&(l||c)?Ir(t,i,r,n,s,a):(l&&Ir(t,i,r,n,s,a,{onlyIcons:!0}),c&&Ir(t,i,r,n,s,a,{onlyText:!0})),i.map.showCollisionBoxes&&(Tr(t,i,r,n,r.paint.get("text-translate"),r.paint.get("text-translate-anchor"),!0),Tr(t,i,r,n,r.paint.get("icon-translate"),r.paint.get("icon-translate-anchor"),!1))},circle:function(t,i,r,n){if("translucent"!==t.renderPass)return;const o=r.paint.get("circle-opacity"),s=r.paint.get("circle-stroke-width"),a=r.paint.get("circle-stroke-opacity"),l=void 0!==r.layout.get("circle-sort-key").constantOr(1),c=r.paint.get("circle-emissive-strength");if(0===o.constantOr(1)&&(0===s.constantOr(1)||0===a.constantOr(1)))return;const h=t.context,u=h.gl,d=t.transform,p=t.depthModeForSublayer(0,e.af.ReadOnly),f=e.ah.disabled,m=t.colorModeForDrapableLayerRenderPass(c),_="globe"===d.projection.name,g=[e.ak(d.center.lng),e.al(d.center.lat)],y=[];for(let o=0;oe.sortKey-t.sortKey));const x={useDepthForOcclusion:d.depthOcclusionForSymbolsAndCircles};for(const i of y){const{programConfiguration:n,program:o,layoutVertexBuffer:s,globeExtVertexBuffer:a,indexBuffer:l,uniformValues:c,tile:_}=i.state,g=i.segments;t.terrain&&t.terrain.setupElevationDraw(_,o,x),t.uploadCommonUniforms(h,o,_.tileID.toUnwrapped()),o.draw(t,u.TRIANGLES,p,f,m,e.ag.disabled,c,r.id,s,l,g,r.paint,d.zoom,n,[a])}},heatmap:function(t,i,r,n){if(0!==r.paint.get("heatmap-opacity"))if("offscreen"===t.renderPass){const o=t.context,s=o.gl,a=e.ah.disabled,l=new e.a([s.ONE,s.ONE,s.ONE,s.ONE],e.C.transparent,[!0,!0,!0,!0]);!(function(e,t,i,r){const n=e.gl,o=t.width*r,s=t.height*r;e.activeTexture.set(n.TEXTURE1),e.viewport.set([0,0,o,s]);let a=i.heatmapFbo;if(!a||a&&(a.width!==o||a.height!==s)){a&&a.destroy();const t=n.createTexture();n.bindTexture(n.TEXTURE_2D,t),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.LINEAR),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,n.LINEAR),a=i.heatmapFbo=e.createFramebuffer(o,s,!0,null),(function(e,t,i,r,n,o){const s=e.gl;s.texImage2D(s.TEXTURE_2D,0,e.extRenderToTextureHalfFloat?s.RGBA16F:s.RGBA,n,o,0,s.RGBA,e.extRenderToTextureHalfFloat?s.HALF_FLOAT:s.UNSIGNED_BYTE,null),r.colorAttachment.set(i)})(e,0,t,a,o,s)}else n.bindTexture(n.TEXTURE_2D,a.colorAttachment.get()),e.bindFramebuffer.set(a.framebuffer)})(o,t,r,"globe"===t.transform.projection.name?.5:.25),o.clear({color:e.C.transparent});const c=t.transform,h="globe"===c.projection.name,u=h?["PROJECTION_GLOBE_VIEW"]:[],d=h?e.ag.frontCCW:e.ag.disabled,p=[e.ak(c.center.lng),e.al(c.center.lat)];for(let f=0;f({u_image:0,u_color_ramp:1,u_opacity:t.paint.get("heatmap-opacity")}))(0,i),i.id,t.viewportBuffer,t.quadTriangleIndexBuffer,t.viewportSegments,i.paint,t.transform.zoom)})(t,r))},line:function(t,i,r,n){if("translucent"!==t.renderPass)return;const o=r.paint.get("line-opacity"),s=r.paint.get("line-width");if(0===o.constantOr(1)||0===s.constantOr(1))return;const a=r.paint.get("line-emissive-strength"),l=r.paint.get("line-occlusion-opacity"),c=t.context,h=c.gl,u=r.layout.get("line-z-offset"),d=!u.isConstant()||!!u.constantOr(0),p=d?new e.af(t.depthOcclusion?h.GREATER:h.LEQUAL,e.af.ReadOnly,t.depthRangeFor3D):t.depthModeForSublayer(0,e.af.ReadOnly),f=t.colorModeForDrapableLayerRenderPass(a),m=t.terrain&&t.terrain.renderingToTexture,_=m?1:e.e.devicePixelRatio,g=r.paint.get("line-dasharray"),y=g.constantOr(1),x=r.layout.get("line-cap"),v=g.constantOr(null),b=x.constantOr(null),w=r.paint.get("line-pattern"),T=w.constantOr(1),E=w.constantOr(null),S=r.paint.get("line-opacity").constantOr(1);let M=!T&&1!==S||t.depthOcclusion&&l>0&&l<1;const A=r.paint.get("line-gradient"),I=T?"linePattern":"line",C=e.bV(r);let P;if(m&&t.terrain&&t.terrain.clipOrMaskOverlapStencilType()&&(M=!1),0!==l&&t.depthOcclusion){const t=r.paint._values["line-opacity"];t&&t.value&&"constant"===t.value.kind?P=t.value:e.w(`Occlusion opacity for layer ${r.id} is supported only when line-opacity isn't data-driven.`)}if(d&&(t.forceTerrainMode=!0),!d&&0!==l&&t.terrain&&!m)return void e.w(`Occlusion opacity for layer ${r.id} is supported on terrain only if the layer has non-zero line-z-offset.`);const z=M&&d?t.stencilModeFor3D():e.ah.disabled;for(const o of n){const n=i.getTile(o);if(T&&!n.patternsLoaded())continue;const s=n.getBucket(r);if(!s)continue;t.prepareDrawTile();const a=s.programConfigurations.get(r.id),u=t.isTileAffectedByFog(o),g=t.getOrCreateProgram(I,{config:a,defines:d?[...C,"ELEVATED"]:C,overrideFog:u});if(E&&n.imageAtlas){const e=n.imageAtlas.patternPositions[E.toString()];e&&a.setConstantPatternPositions(e)}if(!T&&v&&b&&n.lineAtlas){const e=n.lineAtlas.getDash(v,b);e&&a.setConstantPatternPositions(e)}let[x,w]=r.paint.get("line-trim-offset");if("round"===b||"square"===b){const e=1;x!==w&&(0===x&&(x-=e),1===w&&(w+=e))}const D=m?o.projMatrix:null,R=T?e.bW(t,n,r,D,_,[x,w]):e.bX(t,n,r,D,s.lineClipsArray.length,_,[x,w]);if(A){const n=s.gradients[r.id];let a=n.texture;if(r.gradientVersion!==n.version){let l=256;if(r.stepInterpolant){const r=i.getSource().maxzoom,n=o.canonical.z===r?Math.ceil(1<{null!=P&&(P.value=S*l),g.draw(t,h.TRIANGLES,p,i,f,e.ag.disabled,R,r.id,s.layoutVertexBuffer,s.indexBuffer,s.segments,r.paint,t.transform.zoom,a,[s.layoutVertexBuffer2,s.patternVertexBuffer,s.zOffsetVertexBuffer]),null!=P&&(P.value=S)};if(M&&!d){const i=t.stencilModeForClipping(o).ref;0===i&&m&&c.clear({stencil:0});const r={func:h.EQUAL,mask:255};R.u_alpha_discard_threshold=.8,L(new e.ah(r,i,255,h.KEEP,h.KEEP,h.INVERT)),R.u_alpha_discard_threshold=0,L(new e.ah(r,i,255,h.KEEP,h.KEEP,h.KEEP))}else M&&d&&(R.u_alpha_discard_threshold=.001),L(d?z:t.stencilModeForClipping(o))}M&&(t.resetStencilClippingMasks(),m&&c.clear({stencil:0})),0===l||t.depthOcclusion||m||t.layersWithOcclusionOpacity.push(t.currentLayer),d&&(t.forceTerrainMode=!1)},fill:function(t,i,r,n){const o=r.paint.get("fill-color"),s=r.paint.get("fill-opacity");if(0===s.constantOr(1))return;const a=r.paint.get("fill-emissive-strength"),l=t.colorModeForDrapableLayerRenderPass(a),c=r.paint.get("fill-pattern"),h=t.opaquePassEnabledForLayer()&&!c.constantOr(1)&&1===o.constantOr(e.C.transparent).a&&1===s.constantOr(0)?"opaque":"translucent";if(t.renderPass===h){const o=t.depthModeForSublayer(1,"opaque"===t.renderPass?e.af.ReadWrite:e.af.ReadOnly);Pr(t,i,r,n,o,l,!1)}if("translucent"===t.renderPass&&r.paint.get("fill-antialias")){const o=t.depthModeForSublayer(r.getPaintProperty("fill-outline-color")?2:0,e.af.ReadOnly);Pr(t,i,r,n,o,l,!0)}},"fill-extrusion":function(t,i,r,n){const o=r.paint.get("fill-extrusion-opacity"),s=t.context,a=s.gl,l=t.terrain,c=l&&l.renderingToTexture;if(0===o)return;const h=t.conflationActive&&t.style.isLayerClipped(r,i.getSource()),u=t.style.order.indexOf(r.fqid);if(h&&(function(e,t,i,r,n){for(const o of r){const r=t.getTile(o).getBucket(i);r&&(r.updateReplacement(o,e.replacementSource,n),r.uploadCentroid(e.context))}})(t,i,r,n,u),l||h)for(const e of n){const n=i.getTile(e).getBucket(r);n&&Rr(t.context,i,e,n,r,l,h)}if("shadow"===t.renderPass&&t.shadowRenderer){const s=t.shadowRenderer;if(l&&o<.65&&r._transitionablePaint._values["fill-extrusion-opacity"].value.expression instanceof e.Z)return;const a=s.getShadowPassDepthMode(),c=s.getShadowPassColorMode();zr(t,i,r,n,a,e.ah.disabled,c,h)}else if("translucent"===t.renderPass){const u=!r.paint.get("fill-extrusion-pattern").constantOr(1),d=r.paint.get("fill-extrusion-color").constantOr(e.C.white);if(!c&&0!==d.a){const s=new e.af(t.context.gl.LEQUAL,e.af.ReadWrite,t.depthRangeFor3D);1===o&&u?zr(t,i,r,n,s,e.ah.disabled,e.a.unblended,h):(zr(t,i,r,n,s,e.ah.disabled,e.a.disabled,h),zr(t,i,r,n,s,t.stencilModeFor3D(),t.colorModeForRenderPass(),h),t.resetStencilClippingMasks())}if(t.style.enable3dLights()&&u&&(!l&&"globe"!==t.transform.projection.name||c)){const o=r.paint.get("fill-extrusion-opacity"),u=r.paint.get("fill-extrusion-ambient-occlusion-intensity"),d=r.paint.get("fill-extrusion-ambient-occlusion-ground-radius"),p=r.paint.get("fill-extrusion-flood-light-intensity"),f=r.paint.get("fill-extrusion-flood-light-color").toRenderColor(r.lut).toArray01().slice(0,3),m=u>0&&d>0,_=p>0,g=(e,t,i)=>(1-i)*e+i*t,y=s=>{const l=t.depthModeForSublayer(1,e.af.ReadOnly,a.LEQUAL,!0),c=r.paint.get(s?"fill-extrusion-ambient-occlusion-ground-attenuation":"fill-extrusion-flood-light-ground-attenuation"),m=g(.1,3,c),_=t._showOverdrawInspector;if(!_){const c=new e.ah({func:a.ALWAYS,mask:255},255,255,a.KEEP,a.KEEP,a.REPLACE),_=new e.a([a.ONE,a.ONE,a.ONE,a.ONE],e.C.transparent,[!1,!1,!1,!0],a.MIN);Dr(t,i,r,n,l,c,_,e.ag.disabled,s,"sdf",o,u,d,p,f,m,h,!1)}{const c=_?e.ah.disabled:new e.ah({func:a.EQUAL,mask:255},255,255,a.KEEP,a.DECR,a.DECR),g=_?t.colorModeForRenderPass():new e.a([a.ONE_MINUS_DST_ALPHA,a.DST_ALPHA,a.ONE,a.ONE],e.C.transparent,[!0,!0,!0,!0]);Dr(t,i,r,n,l,c,g,e.ag.disabled,s,"color",o,u,d,p,f,m,h,!1)}};if(c){const c=(s,l,c)=>{const m=t.depthModeForSublayer(1,e.af.ReadOnly,a.LEQUAL,!1),_=r.paint.get(s?"fill-extrusion-ambient-occlusion-ground-attenuation":"fill-extrusion-flood-light-ground-attenuation"),y=g(.1,3,_);{const c=new e.a([a.ONE,a.ONE,a.ONE,a.ONE],e.C.transparent,[!1,!1,!1,!0]);Dr(t,i,r,n,m,e.ah.disabled,c,e.ag.disabled,s,"clear",o,u,d,p,f,y,h,l)}{const c=new e.ah({func:a.ALWAYS,mask:255},255,255,a.KEEP,a.KEEP,a.REPLACE),_=new e.a([a.ONE,a.ONE,a.ONE,a.ONE],e.C.transparent,[!1,!1,!1,!0],a.MIN);Dr(t,i,r,n,m,c,_,e.ag.disabled,s,"sdf",o,u,d,p,f,y,h,l)}{const c=s?a.ZERO:a.ONE_MINUS_DST_ALPHA,_=new e.ah({func:a.EQUAL,mask:255},255,255,a.KEEP,a.DECR,a.DECR),g=new e.a([c,a.DST_ALPHA,a.ONE_MINUS_DST_ALPHA,a.ZERO],e.C.transparent,[!0,!0,!0,!0]);Dr(t,i,r,n,m,_,g,e.ag.disabled,s,"color",o,u,d,p,f,y,h,l)}{const _=new e.a([a.ONE,a.ONE,a.ONE,s?a.ZERO:a.ONE],e.C.transparent,[!1,!1,!1,!0],s?a.FUNC_ADD:a.MAX);Dr(t,i,r,n,m,e.ah.disabled,_,e.ag.disabled,s,"clear",o,u,d,p,f,y,h,l,c)}};if(m||_){let i;if(t.prepareDrawTile(),l){const t=l.drapeBufferSize[0],r=l.drapeBufferSize[1];i=l.framebufferCopyTexture,i&&(!i||i.size[0]===t&&i.size[1]===r)||(i&&i.destroy(),i=l.framebufferCopyTexture=new e.T(s,new e.j({width:t,height:r}),a.RGBA)),i.bind(a.LINEAR,a.CLAMP_TO_EDGE),a.copyTexImage2D(a.TEXTURE_2D,0,a.RGBA,0,0,t,r,0)}m&&c(!0,!1,i),_&&c(!1,!0,i)}}else m&&y(!0),_&&y(!1),(m||_)&&t.resetStencilClippingMasks()}}},hillshade:function(t,i,r,n){if("offscreen"!==t.renderPass&&"translucent"!==t.renderPass)return;if(t.style.disableElevatedTerrain)return;const o=t.context,s=t.terrain&&t.terrain.renderingToTexture,[a,l]="translucent"!==t.renderPass||s?[{},n]:t.stencilConfigForOverlap(n);for(const n of l){const o=i.getTile(n);if(o.needsHillshadePrepare&&"offscreen"===t.renderPass)kt(t,o,r);else if("translucent"===t.renderPass){const i=t.depthModeForSublayer(0,e.af.ReadOnly),l=r.paint.get("hillshade-emissive-strength"),c=t.colorModeForDrapableLayerRenderPass(l),h=s&&t.terrain?t.terrain.stencilModeForRTTOverlap(n):a[n.overscaledZ];Rt(t,n,o,r,i,h,c)}}o.viewport.set([0,0,t.width,t.height]),t.resetStencilClippingMasks()},raster:function(t,i,r,n,o,s){if("translucent"!==t.renderPass)return;if(0===r.paint.get("raster-opacity"))return;const a="globe"===t.transform.projection.name,l=0!==r.paint.get("raster-elevation"),c=l&&a;if(t.renderElevatedRasterBackface&&!c)return;const h=t.context,u=h.gl,d=i.getSource(),p=(function(t,i,r,n){const o=i.paint.get("raster-color"),s="raster-array"===t.type,a=[],l=i.paint.get("raster-resampling"),c=i.paint.get("raster-color-mix");let h=i.paint.get("raster-color-range");const u=[c[0],c[1],c[2],0],d=c[3];let p="nearest"===l?n.NEAREST:n.LINEAR;if(s&&(a.push("RASTER_ARRAY"),o||a.push("RASTER_COLOR"),"linear"===l&&a.push("RASTER_ARRAY_LINEAR"),p=n.NEAREST,!h&&t.rasterLayers)){const e=t.rasterLayers.find((({id:e})=>e===i.sourceLayer));e&&e.fields&&e.fields.range&&(h=e.fields.range)}if(h=h||[0,1],o){a.push("RASTER_COLOR"),r.activeTexture.set(n.TEXTURE2),i.updateColorRamp(h);let t=i.colorRampTexture;t||(t=i.colorRampTexture=new e.T(r,i.colorRamp,n.RGBA)),t.bind(n.LINEAR,n.CLAMP_TO_EDGE)}return{mix:u,range:h,offset:d,defines:a,resampling:p}})(d,r,h,u);if(d instanceof e.bo&&!n.length&&!a)return;const f=r.paint.get("raster-emissive-strength"),m=t.colorModeForDrapableLayerRenderPass(f),_=t.terrain&&t.terrain.renderingToTexture,g=!t.options.moving,y="nearest"===r.paint.get("raster-resampling")?u.NEAREST:u.LINEAR;if(d instanceof e.bo&&!n.length&&(d.onNorthPole||d.onSouthPole)){const n=l?t.stencilModeFor3D():e.ah.disabled;return void Nr(!!d.onNorthPole,null,t,i,r,f,p,e.ag.disabled,n)}if(!n.length)return;const[x,v]=d instanceof e.bo||_?[{},n]:t.stencilConfigForOverlap(n),b=v[v.length-1].overscaledZ;c&&p.defines.push("PROJECTION_GLOBE_VIEW"),l&&p.defines.push("RENDER_CUTOFF");const w=(n,o,v)=>{for(const w of n){const n=w.toUnwrapped(),T=i.getTile(w);if(_&&(!T||!T.hasData()))continue;h.activeTexture.set(u.TEXTURE0);const E=Ur(T,d,r,p);if(!E||!E.texture)continue;const{texture:S,mix:M,offset:A,tileSize:I,buffer:C}=E;let P,z;_?(P=e.af.disabled,z=w.projMatrix):l?(P=new e.af(u.LEQUAL,e.af.ReadWrite,t.depthRangeFor3D),z=a?Float32Array.from(t.transform.expandedFarZProjMatrix):t.transform.calculateProjMatrix(n,g)):(P=t.depthModeForSublayer(w.overscaledZ-b,1===r.paint.get("raster-opacity")?e.af.ReadWrite:e.af.ReadOnly,u.LESS),z=t.transform.calculateProjMatrix(n,g));const D=t.terrain&&_?t.terrain.stencilModeForRTTOverlap(w):x[w.overscaledZ],R=s?0:r.paint.get("raster-fade-duration");T.registerFadeDuration(R);const L=i.findLoadedParent(w,0),k=Pi(T,L,i,t.transform,R);let O,B;t.terrain&&t.terrain.prepareDrawTile(),h.activeTexture.set(u.TEXTURE0),S.bind(y,u.CLAMP_TO_EDGE),h.activeTexture.set(u.TEXTURE1),L?(L.texture&&L.texture.bind(y,u.CLAMP_TO_EDGE),O=Math.pow(2,L.tileID.overscaledZ-T.tileID.overscaledZ),B=[T.tileID.canonical.x*O%1,T.tileID.canonical.y*O%1]):S.bind(y,u.CLAMP_TO_EDGE),S.useMipmap&&h.extTextureFilterAnisotropic&&t.transform.pitch>20&&u.texParameterf(u.TEXTURE_2D,h.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,h.extTextureFilterAnisotropicMax);const F=t.transform;let N;const V=l?Vr(F):[0,0,0,0];let U,j,$,G,q,Z=0;if(c&&d instanceof e.bo&&d.coordinates.length>3)U=Float32Array.from(e.bh(e.bi(new e.aO(0,0,0)))),j=Float32Array.from(F.globeMatrix),$=Float32Array.from(e.bd(F)),G=[e.ak(F.center.lng),e.al(F.center.lat)],N=d.elevatedGlobePerspectiveTransform,q=d.elevatedGlobeGridMatrix||new Float32Array(9);else if(c){const t=e.be(w.canonical);Z=e.bf(t.getCenter().lat),U=Float32Array.from(e.bh(e.bi(w.canonical))),j=Float32Array.from(F.globeMatrix),$=Float32Array.from(e.bd(F)),G=[e.ak(F.center.lng),e.al(F.center.lat)],N=[0,0],q=Float32Array.from(e.bg(w.canonical,t,Z,F.worldSize/F._pixelsPerMercatorPixel))}else N=d instanceof e.bo?d.perspectiveTransform:[0,0],U=new Float32Array(16),j=new Float32Array(9),$=new Float32Array(16),G=[0,0],q=new Float32Array(9);const W=rr(z,U,j,$,q,B||[0,0],e.a2(t.transform.zoom),G,V,O||1,k,r,N,l?r.paint.get("raster-elevation"):0,2,M,A,p.range,I,C,f),H=t.isTileAffectedByFog(w),X=t.getOrCreateProgram("raster",{defines:p.defines,overrideFog:H});if(t.uploadCommonUniforms(h,X,n),d instanceof e.bo){const i=d.elevatedGlobeVertexBuffer,n=d.elevatedGlobeIndexBuffer;if(_||!a)d.boundsBuffer&&d.boundsSegments&&X.draw(t,u.TRIANGLES,P,e.ah.disabled,m,e.ag.disabled,W,r.id,d.boundsBuffer,t.quadTriangleIndexBuffer,d.boundsSegments);else if(i&&n){const s=F.zoom<=e.b3?d.elevatedGlobeSegments:d.getSegmentsForLongitude(F.center.lng);s&&X.draw(t,u.TRIANGLES,P,e.ah.disabled,m,o,W,r.id,i,n,s)}}else if(c){P=new e.af(u.LEQUAL,e.af.ReadOnly,t.depthRangeFor3D);const i=t.globeSharedBuffers;if(i){const[e,n,s]=i.getGridBuffers(Z,!1);X.draw(t,u.TRIANGLES,P,v||D,t.colorModeForRenderPass(),o,W,r.id,e,n,s)}}else{const{tileBoundsBuffer:i,tileBoundsIndexBuffer:n,tileBoundsSegments:o}=t.getTileBoundsBuffers(T);X.draw(t,u.TRIANGLES,P,D,m,e.ag.disabled,W,r.id,i,n,o)}}if(!(d instanceof e.bo)&&c)for(const s of n){const n=s.canonical.y===(1<>>16,2654435769),((e=Math.imul(e^e>>>16,2654435769))>>>0)/4294967296},n=.9090909090909091;for(let e=0;ee.b$[t](n)));f.push(n);const m=n.canonical.x,_=n.canonical.y;for(const o of f){const a=i.getTile(l?o.wrapped():o);if(!a)continue;const h=a.rasterParticleState;if(!h)continue;const d=o.canonical.x+(1<e.tileID))),d&&(l.activeTexture.set(c.TEXTURE0),t.imageManager.bind(t.context,r.scope));for(const f of v){const v=t.isTileAffectedByFog(f),b=t.getOrCreateProgram(y,{overrideFog:v}),w=f.toUnwrapped(),T=n?f.projMatrix:t.transform.calculateProjMatrix(w);t.prepareDrawTile();const E=i?i.getTile(f):x?x[f.key]:new e.bA(f,u,h.zoom,t),S=d?fr(T,a,s,t,0,r.scope,p,{tileID:f,tileSize:u}):pr(T,a,s,o.toRenderColor(r.lut));t.uploadCommonUniforms(l,b,w);const{tileBoundsBuffer:M,tileBoundsIndexBuffer:A,tileBoundsSegments:I}=t.getTileBoundsBuffers(E);b.draw(t,c.TRIANGLES,_,m,g,e.ag.disabled,S,r.id,M,A,I)}},sky:function(t,i,r){const n=t._atmosphere?e.a2(t.transform.zoom):1,o=r.paint.get("sky-opacity")*n;if(0===o)return;const s=t.context,a=r.paint.get("sky-type"),l=new e.af(s.gl.LEQUAL,e.af.ReadOnly,[0,1]),c=t.frameCounter/1e3%1;"atmosphere"===a?"offscreen"===t.renderPass?r.needsSkyboxCapture(t)&&((function(t,i){const r=t.context,n=r.gl;let o=i.skyboxFbo;if(!o){o=i.skyboxFbo=r.createFramebuffer(32,32,!0,null),i.skyboxGeometry=new rn(r),i.skyboxTexture=r.gl.createTexture(),n.bindTexture(n.TEXTURE_CUBE_MAP,i.skyboxTexture),n.texParameteri(n.TEXTURE_CUBE_MAP,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_CUBE_MAP,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_CUBE_MAP,n.TEXTURE_MIN_FILTER,n.LINEAR),n.texParameteri(n.TEXTURE_CUBE_MAP,n.TEXTURE_MAG_FILTER,n.LINEAR);for(let e=0;e<6;++e)n.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+e,0,n.RGBA,32,32,0,n.RGBA,n.UNSIGNED_BYTE,null)}r.bindFramebuffer.set(o.framebuffer),r.viewport.set([0,0,32,32]);const s=i.getCenter(t,!0),a=t.getOrCreateProgram("skyboxCapture"),l=new Float64Array(16);e.ae.identity(l),e.ae.rotateY(l,l,.5*-Math.PI),nn(t,i,a,l,s,0),e.ae.identity(l),e.ae.rotateY(l,l,.5*Math.PI),nn(t,i,a,l,s,1),e.ae.identity(l),e.ae.rotateX(l,l,.5*-Math.PI),nn(t,i,a,l,s,2),e.ae.identity(l),e.ae.rotateX(l,l,.5*Math.PI),nn(t,i,a,l,s,3),e.ae.identity(l),nn(t,i,a,l,s,4),e.ae.identity(l),e.ae.rotateY(l,l,Math.PI),nn(t,i,a,l,s,5),r.viewport.set([0,0,t.width,t.height])})(t,r),r.markSkyboxValid(t)):"sky"===t.renderPass&&(function(t,i,r,n,o){const s=t.context,a=s.gl,l=t.transform,c=t.getOrCreateProgram("skybox");s.activeTexture.set(a.TEXTURE0),a.bindTexture(a.TEXTURE_CUBE_MAP,i.skyboxTexture);const h=((e,t,i,r,n)=>({u_matrix:e,u_sun_direction:t,u_cubemap:0,u_opacity:r,u_temporal_offset:n}))(l.skyboxMatrix,i.getCenter(t,!1),0,n,o);t.uploadCommonUniforms(s,c),c.draw(t,a.TRIANGLES,r,e.ah.disabled,t.colorModeForRenderPass(),e.ag.backCW,h,"skybox",i.skyboxGeometry.vertexBuffer,i.skyboxGeometry.indexBuffer,i.skyboxGeometry.segment)})(t,r,l,o,c):"gradient"===a&&"sky"===t.renderPass&&(function(t,i,r,n,o){const s=t.context,a=s.gl,l=t.transform,c=t.getOrCreateProgram("skyboxGradient");i.skyboxGeometry||(i.skyboxGeometry=new rn(s)),s.activeTexture.set(a.TEXTURE0);let h=i.colorRampTexture;h||(h=i.colorRampTexture=new e.T(s,i.colorRamp,a.RGBA)),h.bind(a.LINEAR,a.CLAMP_TO_EDGE);const u=((t,i,r,n,o)=>({u_matrix:t,u_color_ramp:0,u_center_direction:i,u_radius:e.ac(r),u_opacity:n,u_temporal_offset:o}))(l.skyboxMatrix,i.getCenter(t,!1),i.paint.get("sky-gradient-radius"),n,o);t.uploadCommonUniforms(s,c),c.draw(t,a.TRIANGLES,r,e.ah.disabled,t.colorModeForRenderPass(),e.ag.backCW,u,"skyboxGradient",i.skyboxGeometry.vertexBuffer,i.skyboxGeometry.indexBuffer,i.skyboxGeometry.segment)})(t,r,l,o,c)},debug:function(t,i,r,n,o,s){for(let a=0;a{a&&(a.useNormalOffset=!0,l||(a.enabled=!0))},h=i.getSource();if("light-beam"===t.renderPass&&"batched-model"!==h.type)return;if("vector"===h.type||"geojson"===h.type)return(function(t,i,r,n,o){const s=t.transform;if("mercator"!==s.projection.name)return void e.w(`Drawing 3D models for ${s.projection.name} projection is not yet implemented`);const a=s.getFreeCameraOptions().position;if(!t.modelManager)return;const l=t.modelManager;r.modelManager=l;const c=t.shadowRenderer;if(!r._unevaluatedLayout._values.hasOwnProperty("model-id"))return;const h=r._unevaluatedLayout._values["model-id"],u=Object.assign({},r.layout.get("model-id").parameters),d=t.style.order.indexOf(r.fqid);for(const p of n){const n=i.getTile(p).getBucket(r);if(!n||n.projection.name!==s.projection.name)continue;const f=n.getModelUris();f&&!n.modelsRequested&&(l.addModelsFromBucket(f,o),n.modelsRequested=!0);const m=gn(p,s);u.zoom=m;const _=h.possiblyEvaluate(u);if(mn(t,n,p),_n.shadowUniformsInitialized=!1,_n.useSingleShadowCascade=!!c&&0===c.getMaxCascadeForTile(p.toUnwrapped()),"shadow"===t.renderPass&&c){if(1===t.currentShadowCascade&&n.isInsideFirstShadowMapFrustum)continue;const i=s.calculatePosMatrix(p.toUnwrapped(),s.worldSize);if(_n.tileMatrix.set(i),_n.shadowTileMatrix=Float32Array.from(c.calculateShadowPassMatrixFromMatrix(i)),_n.aabb.min.fill(0),_n.aabb.max[0]=_n.aabb.max[1]=e.a4,_n.aabb.max[2]=0,vn(n,_n,t,r.scope))continue}const g=1<0&&t.style.isLayerClipped(r,i.getSource())&&n.updateReplacement(p,t.replacementSource,d,o)&&(n.uploaded=!1,n.upload(t.context));for(let e in n.instancesPerModel){const i=n.instancesPerModel[e];i.features.length>0&&(e=_.evaluate(i.features[0].feature,{}));const s=l.getModel(e,o);if(s&&s.uploaded)for(const e of s.nodes)yn(t,r,e,i,y,p,_n)}}})(t,i,r,n,"vector"===h.type?r.scope:""),void c();if(!h.loaded())return;if("batched-model"===h.type)return(function(t,i,r,n){r.resetLayerRenderingStats(t);const o=t.context,s=t.transform,a=t.style.fog,l=t.shadowRenderer;if("mercator"!==s.projection.name)return void e.w(`Drawing 3D landmark models for ${s.projection.name} projection is not yet implemented`);const c=t.transform.getFreeCameraOptions().position,h=e.$.scale([],[c.x,c.y,c.z],t.transform.worldSize);e.$.negate(h,h);const u=e.ae.identity([]),d=e.ci(s.center.lat,s.zoom),p=e.ae.fromScaling([],[1,1,1/d]);e.ae.translate(u,u,h);const f=r.paint.get("model-opacity"),m=new e.af(o.gl.LEQUAL,e.af.ReadWrite,t.depthRangeFor3D),_=new e.af(o.gl.LEQUAL,e.af.ReadOnly,t.depthRangeFor3D),g=new e.b8([1/0,1/0,1/0],[-1/0,-1/0,-1/0]),y="shadow"===t.renderPass,x=y&&l?l.getCurrentCascadeFrustum():s.getFrustum(s.scaleZoom(s.worldSize)),v=r.paint.get("model-front-cutoff"),b=v[2]<1,w=mi(t,r.paint.get("model-cutoff-fade-range")),T=r.getLayerRenderingStats();(function(e,t,i,r){const n=e.terrain?e.terrain.exaggeration():0,o=e.transform.zoom;for(const s of r){const r=t.getTile(s).getBucket(i);r&&(e.conflationActive&&r.updateReplacement(s,e.replacementSource),r.evaluateScale(e,i),e.terrain&&n>0&&r.elevationUpdate(e.terrain,n,s,i.source),r.needsReEvaluation(e,o,i)&&r.evaluate(i))}})(t,i,r,n),(function(){let c,h,d;b?(c=n.length-1,h=-1,d=-1):(c=0,h=n.length,d=1);for(let E=c;E!==h;E+=d){const c=n[E],h=i.getTile(c).getBucket(r);if(!h||!h.uploaded)continue;let d=!1;l&&(d=0===l.getMaxCascadeForTile(c.toUnwrapped()));const S=s.calculatePosMatrix(c.toUnwrapped(),s.worldSize),M=h.modelTraits,A=[];for(const i of h.getNodesInfo()){if(i.hiddenByReplacement)continue;if(!i.node.meshes)continue;const r=i.node;let n=0;t.terrain&&r.elevation&&(n=r.elevation*t.terrain.exaggeration());const o=i.evaluatedScale;if(o[0]<=1&&o[1]<=1&&o[2]<=1&&0===(()=>{const t=i.aabb;return g.min=[...t.min],g.max=[...t.max],g.min[2]+=n,g.max[2]+=n,e.$.transformMat4(g.min,g.min,S),e.$.transformMat4(g.max,g.max,S),g})().intersects(x))continue;const a=[...S],l=r.anchor?r.anchor[0]:0,c=r.anchor?r.anchor[1]:0;e.ae.translate(a,a,[l*(o[0]-1),c*(o[1]-1),n]),e.$.exactEquals(o,e.cl)||e.ae.scale(a,a,o);const h=e.ae.multiply([],a,r.matrix),u=e.ae.multiply([],s.expandedFarZProjMatrix,h),d=e.ae.multiply([],s.expandedFarZProjMatrix,a),p=e.aB.transformMat4([],[l,c,n,1],u)[2];r.hidden=!1;let m=f;y||(b&&(m*=wn(a,s,i.aabb,v)),m*=bn(w,p)),0!==m?A.push({nodeInfo:i,depth:p,opacity:m,wvpForNode:u,wvpForTile:d,nodeModelMatrix:h,tileModelMatrix:a}):r.hidden=!0}y||A.sort(((e,t)=>!b||1===e.opacity&&1===t.opacity?e.deptht.depth?-1:1));for(const i of A){const n=i.nodeInfo,c=n.node;let h=e.ae.multiply([],p,i.tileModelMatrix);e.ae.multiply(h,u,h);const f=e.ae.invert([],h);e.ae.transpose(f,f),e.ae.scale(f,f,xn),h=e.ae.multiply(h,h,c.matrix);const g="light-beam"===t.renderPass,x=M&e.cn.HasMapboxMeshFeatures,v=x?0:n.evaluatedRMEA[0][2];for(let u=0;u=it||n>=it}}const A=p.material;let I;A.occlusionTexture&&A.occlusionTexture.offsetScale&&(I=A.occlusionTexture.offsetScale,E.defines.push("OCCLUSION_TEXTURE_TRANSFORM")),!y&&l&&(l.useNormalOffset=!!p.normalBuffer);const C=t.getOrCreateProgram("model",E);!y&&l&&l.setupShadowsFromMatrix(i.tileModelMatrix,C,l.useNormalOffset),t.uploadCommonUniforms(o,C,null,M);const P=A.pbrMetallicRoughness;P.metallicFactor=.9,P.roughnessFactor=.5;const z=_r(new Float32Array(w),new Float32Array(h),new Float32Array(f),new Float32Array(c.matrix),t,i.opacity,P.baseColorFactor.toRenderColor(null),A.emissiveFactor,P.metallicFactor,P.roughnessFactor,A,v,r,[0,0,0],I);!b&&(n.hasTranslucentParts||i.opacity<1)&&C.draw(t,o.gl.TRIANGLES,m,e.ah.disabled,e.a.disabled,e.ag.backCCW,z,r.id,p.vertexBuffer,p.indexBuffer,p.segments,r.paint,t.transform.zoom,void 0,S),C.draw(t,o.gl.TRIANGLES,b?_:m,e.ah.disabled,b||i.opacity<1||n.hasTranslucentParts?e.a.alphaBlended:e.a.unblended,e.ag.backCCW,z,r.id,p.vertexBuffer,p.indexBuffer,p.segments,r.paint,t.transform.zoom,void 0,S)}}}})()})(t,i,r,n),void c();if("model"!==h.type)return;const u=h.getModels(),d=[],p=t.transform.getFreeCameraOptions().position,f=e.$.scale([],[p.x,p.y,p.z],t.transform.worldSize);e.$.negate(f,f);const m=[],_=[];let g=0;for(const i of u){const n=r.paint.get("model-rotation").constantOr(null),o=r.paint.get("model-scale").constantOr(null),s=r.paint.get("model-translation").constantOr(null);i.computeModelMatrix(t,n,o,s,!0,!0,!1);const a=e.ae.identity([]),l=e.ci(i.position.lat,t.transform.zoom),c=e.ae.fromScaling([],[1,1,1/l]);e.ae.translate(a,a,f),d.push({zScaleMatrix:c,negCameraPosMatrix:a});for(const e of i.nodes)pn(t.transform,e,i.matrix,t.transform.expandedFarZProjMatrix,g,m,_);g++}if(m.sort(((e,t)=>t.depth-e.depth)),"shadow"!==t.renderPass){if(1===o)for(const i of _)dn(i,t,r,d[i.modelIndex],e.ah.disabled,t.colorModeForRenderPass());else{for(const i of _)dn(i,t,r,d[i.modelIndex],e.ah.disabled,e.a.disabled);for(const e of _)dn(e,t,r,d[e.modelIndex],t.stencilModeFor3D(),t.colorModeForRenderPass());t.resetStencilClippingMasks()}for(const i of m)dn(i,t,r,d[i.modelIndex],e.ah.disabled,t.colorModeForRenderPass());c()}else{for(const e of _)fn(e.mesh,e.nodeModelMatrix,t,r);for(const e of m)fn(e.mesh,e.nodeModelMatrix,t,r);c()}}},An={model:function(e,t,i){const r=t.getSource();if(!r.loaded())return;if("vector"===r.type||"geojson"===r.type)return void(i.modelManager&&i.modelManager.upload(i,"vector"===r.type?e.scope:""));if("batched-model"===r.type)return;if("model"!==r.type)return;const n=r.getModels();for(const e of n)e.upload(i.context)},raster:function(e,t,i){const r=t.getSource();if(!(r instanceof zi&&r.loaded()))return;const n=e.sourceLayer||r.rasterLayerIds&&r.rasterLayerIds[0];if(!n)return;const o=e.paint.get("raster-array-band")||r.getInitialBand(n);if(null==o)return;const s=t.getIds().map((e=>t.getTileByID(e)));for(const e of s)e.updateNeeded(n,o)&&r.prepareTile(e,n,o)},"raster-particle":function(e,t,i){const r=t.getSource();if(!(r instanceof zi&&r.loaded()))return;const n=e.sourceLayer||r.rasterLayerIds&&r.rasterLayerIds[0];if(!n)return;const o=e.paint.get("raster-particle-array-band")||r.getInitialBand(n);if(null==o)return;const s=t.getIds().map((e=>t.getTileByID(e)));for(const e of s)e.updateNeeded(n,o)&&r.prepareTile(e,n,o)}};class In{constructor(t,i,r,n){this.context=new ae(t,i),this.transform=r,this._tileTextures={},this.frameCopies=[],this.loadTimeStamps=[],this.tp=n,this._timeStamp=e.e.now(),this._averageFPS=0,this._fpsHistory=[],this._dt=0,this._debugParams={showTerrainProxyTiles:!1,fpsWindow:30,continousRedraw:!1,enabledLayers:{}};const o=["fill","line","symbol","circle","heatmap","fill-extrusion","raster","raster-particle","hillshade","model","background","sky"];for(const e of o)this._debugParams.enabledLayers[e]=!0;n.registerParameter(this._debugParams,["Terrain"],"showTerrainProxyTiles",{},(()=>{this.style.map.triggerRepaint()})),n.registerParameter(this._debugParams,["FPS"],"fpsWindow",{min:1,max:100,step:1}),n.registerBinding(this._debugParams,["FPS"],"continousRedraw",{readonly:!0,label:"continuous redraw"}),n.registerBinding(this,["FPS"],"_averageFPS",{readonly:!0,label:"value"}),n.registerBinding(this,["FPS"],"_averageFPS",{readonly:!0,label:"graph",view:"graph",min:0,max:200});for(const e of o)n.registerParameter(this._debugParams.enabledLayers,["Debug","Layers"],e);this.occlusionParams=new Sn(n),this.setup(),this.numSublayers=e.bx.maxUnderzooming+e.bx.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.deferredRenderGpuTimeQueries=[],this.gpuTimers={},this.frameCounter=0,this._backgroundTiles={},this.conflationActive=!1,this.replacementSource=new e.cp,this.longestCutoffRange=0,this.minCutoffZoom=0,this._fogVisible=!1,this._cachedTileFogOpacities={},this._shadowRenderer=new xi(this),this._wireframeDebugCache=new En,this.renderDefaultNorthPole=!0,this.renderDefaultSouthPole=!0,this.layersWithOcclusionOpacity=[];const s=new e.j({width:1,height:1},Uint8Array.of(0,0,0,0));this.emptyDepthTexture=new e.T(this.context,s,t.RGBA)}updateTerrain(e,t){const i=!!e&&!!e.terrain&&this.transform.projection.supportsTerrain;if(!(i||this._terrain&&this._terrain.enabled))return;this._terrain||(this._terrain=new Bi(this,e));const r=this._terrain;this.transform.elevation=i?r:null,r.update(e,this.transform,t),this.transform.elevation&&!r.enabled&&(this.transform.elevation=null)}_updateFog(e){const t=e.fog;if(!t||"globe"===this.transform.projection.name||t.getOpacity(this.transform.pitch)<1||t.properties.get("horizon-blend")<.03)return void(this.transform.fogCullDistSq=null);const[i,r]=t.getFovAdjustedRange(this.transform._fov);if(i>r)return void(this.transform.fogCullDistSq=null);const n=i+.78*(r-i);this.transform.fogCullDistSq=n*n}get terrain(){return this.transform._terrainEnabled()&&this._terrain&&this._terrain.enabled||this._forceTerrainMode?this._terrain:null}get forceTerrainMode(){return this._forceTerrainMode}set forceTerrainMode(e){e&&!this._terrain&&(this._terrain=new Bi(this,this.style)),this._forceTerrainMode=e}get shadowRenderer(){return this._shadowRenderer&&this._shadowRenderer.enabled?this._shadowRenderer:null}get wireframeDebugCache(){return this._wireframeDebugCache}resize(t,i){if(this.width=t*e.e.devicePixelRatio,this.height=i*e.e.devicePixelRatio,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(const e of this.style.order)this.style._mergedLayers[e].resize()}setup(){const t=this.context,i=new e.bv;i.emplaceBack(0,0),i.emplaceBack(e.a4,0),i.emplaceBack(0,e.a4),i.emplaceBack(e.a4,e.a4),this.tileExtentBuffer=t.createVertexBuffer(i,e.bt.members),this.tileExtentSegments=e.b.simpleSegment(0,0,4,2);const r=new e.bv;r.emplaceBack(0,0),r.emplaceBack(e.a4,0),r.emplaceBack(0,e.a4),r.emplaceBack(e.a4,e.a4),this.debugBuffer=t.createVertexBuffer(r,e.bt.members),this.debugSegments=e.b.simpleSegment(0,0,4,5);const n=new e.bv;n.emplaceBack(-1,-1),n.emplaceBack(1,-1),n.emplaceBack(-1,1),n.emplaceBack(1,1),this.viewportBuffer=t.createVertexBuffer(n,e.bt.members),this.viewportSegments=e.b.simpleSegment(0,0,4,2);const o=new e.cq;o.emplaceBack(0,0,0,0),o.emplaceBack(e.a4,0,e.a4,0),o.emplaceBack(0,e.a4,0,e.a4),o.emplaceBack(e.a4,e.a4,e.a4,e.a4),this.mercatorBoundsBuffer=t.createVertexBuffer(o,e.cr.members),this.mercatorBoundsSegments=e.b.simpleSegment(0,0,4,2);const s=new e.bw;s.emplaceBack(0,1,2),s.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=t.createIndexBuffer(s);const a=new e.cs;for(const e of[0,1,3,2,0])a.emplaceBack(e);this.debugIndexBuffer=t.createIndexBuffer(a),this.emptyTexture=new e.T(t,new e.j({width:1,height:1},Uint8Array.of(0,0,0,0)),t.gl.RGBA),this.identityMat=e.ae.create();const l=this.context.gl;this.stencilClearMode=new e.ah({func:l.ALWAYS,mask:0},0,255,l.ZERO,l.ZERO,l.ZERO),this.loadTimeStamps.push(performance.now())}getMercatorTileBoundsBuffers(){return{tileBoundsBuffer:this.mercatorBoundsBuffer,tileBoundsIndexBuffer:this.quadTriangleIndexBuffer,tileBoundsSegments:this.mercatorBoundsSegments}}getTileBoundsBuffers(e){return e._makeTileBoundsBuffers(this.context,this.transform.projection),e._tileBoundsBuffer?{tileBoundsBuffer:e._tileBoundsBuffer,tileBoundsIndexBuffer:e._tileBoundsIndexBuffer,tileBoundsSegments:e._tileBoundsSegments}:this.getMercatorTileBoundsBuffers()}clearStencil(){const t=this.context.gl;this.nextStencilID=1,this.currentStencilSource=void 0,this._tileClippingMaskIDs={},this.getOrCreateProgram("clippingMask").draw(this,t.TRIANGLES,e.af.disabled,this.stencilClearMode,e.a.disabled,e.ag.disabled,Ci(this.identityMat),"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}resetStencilClippingMasks(){this.terrain||(this.currentStencilSource=void 0,this._tileClippingMaskIDs={})}_renderTileClippingMasks(t,i,r){if(!i||this.currentStencilSource===i.id||!t.isTileClipped()||!r||0===r.length)return;if(this._tileClippingMaskIDs&&!this.terrain){let e=!1;for(const t of r)if(void 0===this._tileClippingMaskIDs[t.key]){e=!0;break}if(!e)return}this.currentStencilSource=i.id;const n=this.context,o=n.gl;this.nextStencilID+r.length>256&&this.clearStencil(),n.setColorMode(e.a.disabled),n.setDepthMode(e.af.disabled);const s=this.getOrCreateProgram("clippingMask");this._tileClippingMaskIDs={};for(const t of r){const r=i.getTile(t),n=this._tileClippingMaskIDs[t.key]=this.nextStencilID++,{tileBoundsBuffer:a,tileBoundsIndexBuffer:l,tileBoundsSegments:c}=this.getTileBoundsBuffers(r);s.draw(this,o.TRIANGLES,e.af.disabled,new e.ah({func:o.ALWAYS,mask:0},n,255,o.KEEP,o.KEEP,o.REPLACE),e.a.disabled,e.ag.disabled,Ci(t.projMatrix),"$clipping",a,l,c)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();const t=this.nextStencilID++,i=this.context.gl;return new e.ah({func:i.NOTEQUAL,mask:255},t,255,i.KEEP,i.KEEP,i.REPLACE)}stencilModeForClipping(t){if(this.terrain)return this.terrain.stencilModeForRTTOverlap(t);const i=this.context.gl;return new e.ah({func:i.EQUAL,mask:255},this._tileClippingMaskIDs[t.key],0,i.KEEP,i.KEEP,i.REPLACE)}stencilConfigForOverlap(t){const i=this.context.gl,r=t.sort(((e,t)=>t.overscaledZ-e.overscaledZ)),n=r[r.length-1].overscaledZ,o=r[0].overscaledZ-n+1;if(o>1){this.currentStencilSource=void 0,this.nextStencilID+o>256&&this.clearStencil();const t={};for(let r=0;rthis.style&&this.style.enable3dLights()&&this.terrain&&this.terrain.renderingToTexture)()&&"translucent"===this.renderPass?new e.a([i.ONE,i.ONE_MINUS_SRC_ALPHA,i.CONSTANT_ALPHA,i.ONE_MINUS_SRC_ALPHA],new e.C(0,0,0,void 0===t?0:t),[!0,!0,!0,!0]):this.colorModeForRenderPass()}depthModeForSublayer(t,i,r,n=!1){if(this.depthOcclusion)return new e.af(this.context.gl.GREATER,e.af.ReadOnly,this.depthRangeFor3D);if(!this.opaquePassEnabledForLayer()&&!n)return e.af.disabled;const o=1-((1+this.currentLayer)*this.numSublayers+t)*this.depthEpsilon;return new e.af(r||this.context.gl.LEQUAL,i,[o,o])}opaquePassEnabledForLayer(){return this.currentLayerthis._debugParams.fpsWindow&&this._fpsHistory.splice(0,this._fpsHistory.length-this._debugParams.fpsWindow),this._averageFPS=Math.round(this._fpsHistory.reduce(((e,t)=>e+t/this._fpsHistory.length),0))}render(t,i){const r=e.e.now();this._dt=r-this._timeStamp,this._timeStamp=r,this._wireframeDebugCache.update(this.frameCounter),this._debugParams.continousRedraw=t.map.repaint,this.style=t,this.options=i;const n=this.style._mergedLayers,o=this.style.order.filter((e=>{const t=n[e];return!(t.type in this._debugParams.enabledLayers)||this._debugParams.enabledLayers[t.type]}));let s=!1,a=!1;for(const e of o){const t=n[e];"circle"===t.type&&(s=!0),"symbol"===t.type&&(t.hasInitialOcclusionOpacityProperties?a=!0:s=!0)}const l=o.map((e=>n[e])),c=this.style._mergedSourceCaches;this.imageManager=t.imageManager,this.modelManager=t.modelManager,this.symbolFadeChange=t.placement.symbolFadeChange(e.e.now()),this.imageManager.beginFrame();let h=0,u=!1;for(const e in c){const t=c[e];t.used&&(t.prepare(this.context),t.getSource().usedInConflation&&++h)}let d=!1;for(const e of l)e.isHidden(this.transform.zoom)||("clip"===e.type&&(d=!0),this.prepareLayer(e));const p={},f={},m={},_={},g={};for(const e in c){const t=c[e];p[e]=t.getVisibleCoordinates(),f[e]=p[e].slice().reverse(),m[e]=t.getVisibleCoordinates(!0).reverse(),_[e]=t.getShadowCasterCoordinates(),g[e]=t.sortCoordinatesByDistance(p[e])}const y=e=>{const t=this.style.getLayerSourceCache(e);return t&&t.used?t.getSource():null};if(h||d){const t=[],i=[];let r=0;for(const e of l)this.isSourceForClippingOrConflation(e,y(e))&&(t.push(e),i.push(r)),r++;if(d||t.length>1){const r=[];for(let n=0;n0){const e=y(t);e&&(this.minCutoffZoom=Math.max(e.minzoom,this.minCutoffZoom)),t.minzoom&&(this.minCutoffZoom=Math.max(t.minzoom,this.minCutoffZoom))}t.is3D()&&(this.opaquePassCutoff===1/0&&(this.opaquePassCutoff=e),this._lastOcclusionLayer=e)}const x=this.style&&this.style.fog;x?(this._fogVisible=0!==x.getOpacity(this.transform.pitch),this._fogVisible&&"globe"!==this.transform.projection.name&&(this._fogVisible=x.isVisibleOnFrustum(this.transform.cameraFrustum))):this._fogVisible=!1,this._cachedTileFogOpacities={},this.terrain&&(this.terrain.updateTileBinding(m),this.opaquePassCutoff=0);const v=this._shadowRenderer;if(v){v.updateShadowParameters(this.transform,this.style.directionalLight);for(const e in c)for(const t of p[e]){let e={min:0,max:0};this.terrain&&(e=this.terrain.getMinMaxForTile(t)||e),v.addShadowReceiver(t.toUnwrapped(),e.min,e.max)}}if("globe"!==this.transform.projection.name||this.globeSharedBuffers||(this.globeSharedBuffers=new e.ct(this.context)),this.style.fog&&this.transform.projection.supportsFog?(this._atmosphere||(this._atmosphere=new cn(this)),this._atmosphere.update(this)):this._atmosphere&&(this._atmosphere.destroy(),this._atmosphere=void 0),!e.cu(this.context.gl))return;this.renderPass="offscreen";for(const e of l){const i=t.getLayerSourceCache(e);if(!e.hasOffscreenPass()||e.isHidden(this.transform.zoom))continue;const r=i?f[i.id]:void 0;("custom"===e.type||"raster"===e.type||"raster-particle"===e.type||e.isSky()||r&&r.length)&&this.renderLayer(this,i,e,r)}this.depthRangeFor3D=[0,1-(l.length+2)*this.numSublayers*this.depthEpsilon],this._shadowRenderer&&(this.renderPass="shadow",this._shadowRenderer.drawShadowPass(this.style,_)),this.context.bindFramebuffer.set(null),this.context.viewport.set([0,0,this.width,this.height]);const b="globe"===this.transform.projection.name||this.transform.isHorizonVisible(),w=(()=>{if(i.showOverdrawInspector)return e.C.black;const t=this.style.fog;if(t&&this.transform.projection.supportsFog){const i=this.style.getLut(t.scope);if(!b){const r=t.properties.get("color").toRenderColor(i).toArray01();return new e.C(...r)}if(b){const r=t.properties.get("space-color").toRenderColor(i).toArray01();return new e.C(...r)}}return e.C.transparent})();if(this.context.clear({color:w,depth:1}),this.clearStencil(),this._showOverdrawInspector=i.showOverdrawInspector,this.renderPass="opaque",this.style.fog&&this.transform.projection.supportsFog&&this._atmosphere&&!this._showOverdrawInspector&&b&&this._atmosphere.drawStars(this,this.style.fog),!this.terrain)for(this.currentLayer=o.length-1;this.currentLayer>=0;this.currentLayer--){const e=l[this.currentLayer],i=t.getLayerSourceCache(e);if(e.isSky())continue;const r=i?(e.is3D()?g:f)[i.id]:void 0;this._renderTileClippingMasks(e,i,r),this.renderLayer(this,i,e,r)}if(this.style.fog&&this.transform.projection.supportsFog&&this._atmosphere&&!this._showOverdrawInspector&&b&&this._atmosphere.drawAtmosphereGlow(this,this.style.fog),this.renderPass="sky",(!this._atmosphere||e.a2(this.transform.zoom)>0)&&("globe"===this.transform.projection.name||this.transform.isHorizonVisible()))for(this.currentLayer=0;this.currentLayer0&&e.hasShadowPass()&&0==--E&&(v.drawGroundShadows(),this.firstLightBeamLayer<=this.currentLayer)){const e=this.currentLayer;for(this.renderPass="light-beam",this.currentLayer=this.firstLightBeamLayer;this.currentLayer<=e;this.currentLayer++){const e=l[this.currentLayer];if(!e.hasLightBeamPass())continue;const i=t.getLayerSourceCache(e);this.renderLayer(this,i,e,i?f[i.id]:void 0)}this.currentLayer=e,this.renderPass="translucent"}if(this.currentLayer>=this._lastOcclusionLayer&&this.layersWithOcclusionOpacity.length>0){const e=this.currentLayer;this.depthOcclusion=!0;for(const e of this.layersWithOcclusionOpacity){this.currentLayer=e;const i=l[this.currentLayer],r=t.getLayerSourceCache(i),n=r?f[r.id]:void 0;i.is3D()||this.terrain||this._renderTileClippingMasks(i,r,r?p[r.id]:void 0),this.renderLayer(this,r,i,n)}this.depthOcclusion=!1,this.currentLayer=e,this.renderPass="translucent",this.layersWithOcclusionOpacity=[]}++this.currentLayer}}if(this.terrain&&this.terrain.postRender(),this.options.showTileBoundaries||this.options.showQueryGeometry||this.options.showTileAABBs){let i=null;l.forEach((e=>{const r=t.getLayerSourceCache(e);r&&!e.isHidden(this.transform.zoom)&&r.getVisibleCoordinates().length&&(!i||i.getSource().maxzoom0?t.pop():null}terrainRenderModeElevated(){return this.style&&!!this.style.getTerrain()&&!!this.terrain&&!this.terrain.renderingToTexture||this.forceTerrainMode}linearFloatFilteringSupported(){return null!=this.context.extTextureFloatLinear}currentGlobalDefines(e,t,i){const r=void 0===i?this.terrain&&this.terrain.renderingToTexture:i,n=[];return this.style&&this.style.enable3dLights()&&("globeRaster"===e||"terrainRaster"===e?(n.push("LIGHTING_3D_MODE"),n.push("LIGHTING_3D_ALPHA_EMISSIVENESS")):r||n.push("LIGHTING_3D_MODE")),"shadow"===this.renderPass?this._shadowMapDebug||n.push("DEPTH_TEXTURE"):this.shadowRenderer&&(this.shadowRenderer.useNormalOffset?n.push("RENDER_SHADOWS","DEPTH_TEXTURE","NORMAL_OFFSET"):n.push("RENDER_SHADOWS","DEPTH_TEXTURE")),this.terrainRenderModeElevated()&&(n.push("TERRAIN"),this.linearFloatFilteringSupported()&&n.push("TERRAIN_DEM_FLOAT_FORMAT")),"globe"===this.transform.projection.name&&n.push("GLOBE"),!this._fogVisible||r||void 0!==t&&!t||n.push("FOG","FOG_DITHERING"),r&&n.push("RENDER_TO_TEXTURE"),this._showOverdrawInspector&&n.push("OVERDRAW_INSPECTOR"),n}getOrCreateProgram(e,t){this.cache=this.cache||{};const i=t&&t.defines||[],r=t&&t.config,n=this.currentGlobalDefines(e,t&&t.overrideFog,t&&t.overrideRtt).concat(i),o=Ui.cacheKey(It[e],e,n,r);return this.cache[o]||(this.cache[o]=new Ui(this.context,e,It[e],r,yr[e],n)),this.cache[o]}setCustomLayerDefaults(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.frontFace.setDefault(),this.context.cullFaceSide.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()}setBaseState(){const 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(){null==this.debugOverlayCanvas&&(this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new e.T(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){this._terrain&&this._terrain.destroy(),this._atmosphere&&(this._atmosphere.destroy(),this._atmosphere=void 0),this.globeSharedBuffers&&this.globeSharedBuffers.destroy(),this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy(),this._wireframeDebugCache.destroy(),this.depthFBO&&(this.depthFBO.destroy(),this.depthFBO=void 0,this.depthTexture=void 0),this.emptyDepthTexture&&this.emptyDepthTexture.destroy()}prepareDrawTile(){this.terrain&&this.terrain.prepareDrawTile()}uploadCommonLightUniforms(t,i){if(this.style.enable3dLights()){const r=this.style.directionalLight,n=this.style.ambientLight;if(r&&n){const o=((t,i,r)=>{const n=t.properties.get("direction"),o=t.properties.get("color").toRenderColor(r.getLut(t.scope)).toArray01(),s=t.properties.get("intensity"),a=i.properties.get("color").toRenderColor(r.getLut(i.scope)).toArray01(),l=i.properties.get("intensity"),c=[n.x,n.y,n.z],h=e.bC(a,l),u=e.bC(o,s);return{u_lighting_ambient_color:h,u_lighting_directional_dir:c,u_lighting_directional_color:u,u_ground_radiance:Fi(c,u,h)}})(r,n,this.style);i.setLightsUniformValues(t,o)}}}uploadCommonUniforms(t,i,r,n,o){if(this.uploadCommonLightUniforms(t,i),this.terrain&&this.terrain.renderingToTexture)return;const s=this.style.fog;if(s){const o=s.getOpacity(this.transform.pitch),a=((t,i,r,n,o,s,a,l,c,h,u,d)=>{const p=t.transform,f=i.properties.get("color").toRenderColor(t.style.getLut(i.scope)).toArray01();f[3]=n;const m=t.frameCounter/1e3%1,[_,g]=i.properties.get("vertical-range");return{u_fog_matrix:r?p.calculateFogTileMatrix(r):d||t.identityMat,u_fog_range:i.getFovAdjustedRange(p._fov),u_fog_color:f,u_fog_horizon_blend:i.properties.get("horizon-blend"),u_fog_vertical_limit:[Math.min(_,g),g],u_fog_temporal_offset:m,u_frustum_tl:o,u_frustum_tr:s,u_frustum_br:a,u_frustum_bl:l,u_globe_pos:c,u_globe_radius:h,u_viewport:u,u_globe_transition:e.a2(p.zoom),u_is_globe:+("globe"===p.projection.name)}})(this,s,r,o,this.transform.frustumCorners.TL,this.transform.frustumCorners.TR,this.transform.frustumCorners.BR,this.transform.frustumCorners.BL,this.transform.globeCenterInViewSpace,this.transform.globeRadius,[this.transform.width*e.e.devicePixelRatio,this.transform.height*e.e.devicePixelRatio],n);i.setFogUniformValues(t,a)}o&&i.setCutoffUniformValues(t,o.uniformValues)}setTileLoadedFlag(e){this.tileLoaded=e}saveCanvasCopy(){const e=this.canvasCopy();e&&(this.frameCopies.push(e),this.tileLoaded=!1)}canvasCopy(){const e=this.context.gl,t=e.createTexture();return e.bindTexture(e.TEXTURE_2D,t),e.copyTexImage2D(e.TEXTURE_2D,0,e.RGBA,0,0,e.drawingBufferWidth,e.drawingBufferHeight,0),t}getCanvasCopiesAndTimestamps(){return{canvasCopies:this.frameCopies,timeStamps:this.loadTimeStamps}}averageElevationNeedsEasing(){if(!this.transform._elevation)return!1;const e=this.style&&this.style.fog;return!!e&&0!==e.getOpacity(this.transform.pitch)}getBackgroundTiles(){const t=this._backgroundTiles,i=this._backgroundTiles={},r=this.transform.coveringTiles({tileSize:512});for(const n of r)i[n.key]=t[n.key]||new e.bA(n,512,this.transform.tileZoom,this);return i}clearBackgroundTiles(){this._backgroundTiles={}}isSourceForClippingOrConflation(e,t){return!(!e.is3D()||e.minzoom&&e.minzoom>this.transform.zoom||(this.style._clipLayerIndices.length||"building"!==e.sourceLayer)&&"clip"!==e.type&&(!t||"batched-model"!==t.type))}isTileAffectedByFog(e){if(!this.style||!this.style.fog)return!1;if("globe"===this.transform.projection.name)return!0;let t=this._cachedTileFogOpacities[e.key];return t||(this._cachedTileFogOpacities[e.key]=t=this.style.fog.getOpacityForTile(e)),t[0]>=it||t[1]>=it}setupDepthForOcclusion(e,t,i){const r=this.context,n=r.gl,o=!!i;var s;i||(i={u_dem:2,u_dem_prev:4,u_dem_tl:[0,0],u_dem_tl_prev:[0,0],u_dem_scale:0,u_dem_scale_prev:0,u_dem_size:0,u_dem_lerp:1,u_depth:3,u_depth_size_inv:[0,0],u_depth_range_unpack:[0,1],u_occluder_half_size:16,u_occlusion_depth_offset:-1e-4,u_exaggeration:0}),r.activeTexture.set(n.TEXTURE3),e&&this.depthFBO&&this.depthTexture?(this.depthTexture.bind(n.NEAREST,n.CLAMP_TO_EDGE),i.u_depth_size_inv=[1/this.depthFBO.width,1/this.depthFBO.height],i.u_depth_range_unpack=[2/((s=this.depthRangeFor3D)[1]-s[0]),-1-2*s[0]/(s[1]-s[0])],i.u_occluder_half_size=.5*this.occlusionParams.occluderSize,i.u_occlusion_depth_offset=this.occlusionParams.depthOffset):this.emptyDepthTexture.bind(n.NEAREST,n.CLAMP_TO_EDGE),r.activeTexture.set(n.TEXTURE0),o||t.setTerrainUniformValues(r,i)}}class Cn{constructor(e,t,i,r){this.screenBounds=e,this.cameraPoint=t,this._screenRaycastCache={},this._cameraRaycastCache={},this.isAboveHorizon=i,this.screenGeometry=this.bufferedScreenGeometry(0),this.screenGeometryMercator=this._bufferedScreenMercator(0,r)}static createFromScreenPoints(t,i){let r,n;if(t instanceof e.P||"number"==typeof t[0]){const o=e.P.convert(t);r=[o],n=i.isPointAboveHorizon(o)}else{const o=e.P.convert(t[0]),s=e.P.convert(t[1]);r=[o,s],n=e.cx(o,s).every((e=>i.isPointAboveHorizon(e)))}return new Cn(r,i.getCameraPoint(),n,i)}isPointQuery(){return 1===this.screenBounds.length}bufferedScreenGeometry(t){return e.cx(this.screenBounds[0],1===this.screenBounds.length?this.screenBounds[0]:this.screenBounds[1],t)}bufferedCameraGeometry(t){const i=this.screenBounds[0],r=1===this.screenBounds.length?this.screenBounds[0].add(new e.P(1,1)):this.screenBounds[1],n=e.cx(i,r,0,!1);return this.cameraPoint.y>r.y&&(this.cameraPoint.x>i.x&&this.cameraPoint.x=r.x?n[2]=this.cameraPoint:this.cameraPoint.x<=i.x&&(n[3]=this.cameraPoint)),e.cy(n,t)}bufferedCameraGeometryGlobe(t){const i=this.screenBounds[0],r=1===this.screenBounds.length?this.screenBounds[0].add(new e.P(1,1)):this.screenBounds[1],n=e.cx(i,r,t),o=this.cameraPoint.clone();switch(3*((o.y>i.y)+(o.y>r.y))+((o.x>i.x)+(o.x>r.x))){case 0:n[0]=o,n[4]=o.clone();break;case 1:n.splice(1,0,o);break;case 2:n[1]=o;break;case 3:n.splice(4,0,o);break;case 5:n.splice(2,0,o);break;case 6:n[3]=o;break;case 7:n.splice(3,0,o);break;case 8:n[2]=o}return n}containsTile(t,i,r,n=0){const o=t.queryPadding/i._pixelsPerMercatorPixel+1,s=r?this._bufferedCameraMercator(o,i):this._bufferedScreenMercator(o,i);let a=t.tileID.wrap+(s.unwrapped?n:0);const l=s.polygon.map((i=>e.cz(t.tileTransform,i,a)));if(!e.cA(l,0,0,e.a4,e.a4))return;a=t.tileID.wrap+(this.screenGeometryMercator.unwrapped?n:0);const c=this.screenGeometryMercator.polygon.map((i=>e.cB(t.tileTransform,i,a))),h=c.map((t=>new e.P(t[0],t[1]))),u=i.getFreeCameraOptions().position||new e._(0,0,0),d=e.cB(t.tileTransform,u,a),p=c.map((t=>{const i=e.$.sub(t,t,d);return e.$.normalize(i,i),new e.aU(d,i)})),f=e.bD(t,1,i.zoom)*i._pixelsPerMercatorPixel;return{queryGeometry:this,tilespaceGeometry:h,tilespaceRays:p,bufferedTilespaceGeometry:l,bufferedTilespaceBounds:(m=e.cC(l),m.min.x=e.au(m.min.x,0,e.a4),m.min.y=e.au(m.min.y,0,e.a4),m.max.x=e.au(m.max.x,0,e.a4),m.max.y=e.au(m.max.y,0,e.a4),m),tile:t,tileID:t.tileID,pixelToTileUnitsFactor:f};var m}_bufferedScreenMercator(e,t){const i=Dn(e);if(this._screenRaycastCache[i])return this._screenRaycastCache[i];{let r;return r="globe"===t.projection.name?this._projectAndResample(this.bufferedScreenGeometry(e),t):{polygon:this.bufferedScreenGeometry(e).map((e=>t.pointCoordinate3D(e))),unwrapped:!0},this._screenRaycastCache[i]=r,r}}_bufferedCameraMercator(e,t){const i=Dn(e);if(this._cameraRaycastCache[i])return this._cameraRaycastCache[i];{let r;return r="globe"===t.projection.name?this._projectAndResample(this.bufferedCameraGeometryGlobe(e),t):{polygon:this.bufferedCameraGeometry(e).map((e=>t.pointCoordinate3D(e))),unwrapped:!0},this._cameraRaycastCache[i]=r,r}}_projectAndResample(t,i){const r=(function(t,i){const r=e.ae.multiply([],i.pixelMatrix,i.globeMatrix),n=[0,-e.cF,0,1],o=[0,e.cF,0,1],s=[0,0,0,1];e.aB.transformMat4(n,n,r),e.aB.transformMat4(o,o,r),e.aB.transformMat4(s,s,r);const a=new e.P(n[0]/n[3],n[1]/n[3]),l=new e.P(o[0]/o[3],o[1]/o[3]),c=e.cD(t,a)&&n[3]1?Pn(t.slice(0,d),i):[],m=dnew e.P(zn(t.x),t.y))),m=m.map((t=>new e.P(zn(t.x),t.y)));const _=[...f];0===_.length&&_.push(m[m.length-1]);const g=e.a3(_[_.length-1].y,(0===m.length?f[0]:m[0]).y,p);let y;return y=c?[new e.P(0,g),new e.P(0,0),new e.P(1,0),new e.P(1,g)]:[new e.P(1,g),new e.P(1,1),new e.P(0,1),new e.P(0,g)],_.push(...y),0===m.length?_.push(f[0]):_.push(...m),{polygon:_.map((t=>new e._(t.x,t.y))),unwrapped:!1}})(t,i);if(r)return r;const n=(function(t,i){let r=!1,n=-1/0,o=0;for(let e=0;en&&(n=t[e].x,o=e);for(let e=0;e.5&&(n.x{e.x-=1})),{polygon:t,unwrapped:r}})(Pn(t,i).map((t=>new e.P(zn(t.x),t.y))),i);return{polygon:n.polygon.map((t=>new e._(t.x,t.y))),unwrapped:n.unwrapped}}}function Pn(t,i){return e.cE(t,(e=>{const t=i.pointCoordinate3D(e);e.x=t.x,e.y=t.y}),.00390625)}function zn(e){return e<0?1+e%1:e%1}function Dn(e){return 100*e|0}function Rn(t,i){const r=e.ae.identity([]);return e.ae.scale(r,r,[.5*t.width,.5*-t.height,1]),e.ae.translate(r,r,[1,-1,0]),e.ae.multiply(r,r,t.calculateProjMatrix(i.toUnwrapped())),Float32Array.from(r)}function Ln(e,t,i,r,n,o,s,a=!1){const l=e.tilesIn(r,s,a);l.sort(On);const c=[];for(const r of l)c.push({wrappedTileID:r.tile.tileID.wrapped().key,queryResults:r.tile.queryRenderedFeatures(t,i,e._state,r,n,o,Rn(e.transform,r.tile.tileID),a)});const h=(function(e){const t={},i={};for(const r of e){const e=r.queryResults,n=r.wrappedTileID,o=i[n]=i[n]||{};for(const i in e){const r=e[i],n=o[i]=o[i]||{},s=t[i]=t[i]||[];for(const e of r)n[e.featureIndex]||(n[e.featureIndex]=!0,s.push(e))}}return t})(c);for(const t in h)h[t].forEach((t=>{const i=t.feature,r=i.layer;r&&"background"!==r.type&&"sky"!==r.type&&"slot"!==r.type&&(i.source=r.source,r["source-layer"]&&(i.sourceLayer=r["source-layer"]),i.state=void 0!==i.id?e.getFeatureState(r["source-layer"],i.id):{})}));return h}function kn(e,t){const i=e.getRenderableIds().map((t=>e.getTileByID(t))),r=[],n={};for(let e=0;e0:"model"===i.type&&(r=!i.isHidden(e)&&i.paint.get("model-opacity")>0),this.layersGotHidden=this.layersGotHidden||!r&&t.visible,t.visible=r}}updateZOffset(e,t){this.currentBuildingBuckets=[];for(const e of this.layers){const i=e.layer,r=this.style.getLayerSourceCache(i);let n=1;"fill-extrusion"===i.type&&(n=e.visible?i.paint.get("fill-extrusion-vertical-scale"):0);let o=r?r.getTile(t):null;if(!o&&r&&t.canonical.z>r.getSource().minzoom){let e=t.scaledTo(Math.min(r.getSource().maxzoom,t.overscaledZ-1));for(;e.overscaledZ>=r.getSource().minzoom&&(o=r.getTile(e),!o&&0!==e.overscaledZ);)e=e.scaledTo(e.overscaledZ-1)}this.currentBuildingBuckets.push({bucket:o?o.getBucket(i):null,tileID:o?o.tileID:t,verticalScale:n})}e.hasAnyZOffset=!1;let i=!1;for(let r=0;r{e in i&&(r[e]=i[e])})),r}function Nn(e){e=e.slice();const t=Object.create(null);for(let i=0;i0?(n-s)/a:0;return this.points[o].mult(1-l).add(this.points[i].mult(l))}}class Xn{constructor(e,t,i){const r=this.boxCells=[],n=this.circleCells=[];this.xCellCount=Math.ceil(e/i),this.yCellCount=Math.ceil(t/i);for(let e=0;ethis.width||r<0||t>this.height)return!n&&[];const s=[];if(e<=0&&t<=0&&this.width<=i&&this.height<=r){if(n)return!0;for(let e=0;e0:s}_queryCircle(e,t,i,r,n){const o=e-i,s=e+i,a=t-i,l=t+i;if(s<0||o>this.width||l<0||a>this.height)return!r&&[];const c=[];return this._forEachCell(o,a,s,l,this._queryCellCircle,c,{hitTest:r,circle:{x:e,y:t,radius:i},seenUids:{box:{},circle:{}}},n),r?c.length>0:c}query(e,t,i,r,n){return this._query(e,t,i,r,!1,n)}hitTest(e,t,i,r,n){return this._query(e,t,i,r,!0,n)}hitTestCircle(e,t,i,r){return this._queryCircle(e,t,i,!0,r)}_queryCell(e,t,i,r,n,o,s,a){const l=s.seenUids,c=this.boxCells[n];if(null!==c){const n=this.bboxes;for(const h of c)if(!l.box[h]){l.box[h]=!0;const c=4*h;if(e<=n[c+2]&&t<=n[c+3]&&i>=n[c+0]&&r>=n[c+1]&&(!a||a(this.boxKeys[h]))){if(s.hitTest)return o.push(!0),!0;o.push({key:this.boxKeys[h],x1:n[c],y1:n[c+1],x2:n[c+2],y2:n[c+3]})}}}const h=this.circleCells[n];if(null!==h){const n=this.circles;for(const c of h)if(!l.circle[c]){l.circle[c]=!0;const h=3*c;if(this._circleAndRectCollide(n[h],n[h+1],n[h+2],e,t,i,r)&&(!a||a(this.circleKeys[c]))){if(s.hitTest)return o.push(!0),!0;{const e=n[h],t=n[h+1],i=n[h+2];o.push({key:this.circleKeys[c],x1:e-i,y1:t-i,x2:e+i,y2:t+i})}}}}}_queryCellCircle(e,t,i,r,n,o,s,a){const l=s.circle,c=s.seenUids,h=this.boxCells[n];if(null!==h){const e=this.bboxes;for(const t of h)if(!c.box[t]){c.box[t]=!0;const i=4*t;if(this._circleAndRectCollide(l.x,l.y,l.radius,e[i+0],e[i+1],e[i+2],e[i+3])&&(!a||a(this.boxKeys[t])))return o.push(!0),!0}}const u=this.circleCells[n];if(null!==u){const e=this.circles;for(const t of u)if(!c.circle[t]){c.circle[t]=!0;const i=3*t;if(this._circlesCollide(e[i],e[i+1],e[i+2],l.x,l.y,l.radius)&&(!a||a(this.circleKeys[t])))return o.push(!0),!0}}}_forEachCell(e,t,i,r,n,o,s,a){const l=this._convertToXCellCoord(e),c=this._convertToYCellCoord(t),h=this._convertToXCellCoord(i),u=this._convertToYCellCoord(r);for(let d=l;d<=h;d++)for(let l=c;l<=u;l++)if(n.call(this,e,t,i,r,this.xCellCount*l+d,o,s,a))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,t,i,r,n,o){const s=r-e,a=n-t,l=i+o;return l*l>s*s+a*a}_circleAndRectCollide(e,t,i,r,n,o,s){const a=(o-r)/2,l=Math.abs(e-(r+a));if(l>a+i)return!1;const c=(s-n)/2,h=Math.abs(t-(n+c));if(h>c+i)return!1;if(l<=a||h<=c)return!0;const u=l-a,d=h-c;return u*u+d*d<=i*i}}const Yn=100;class Jn{constructor(e,t,i=new Xn(e.width+200,e.height+200,25),r=new Xn(e.width+200,e.height+200,25)){this.transform=e,this.grid=i,this.ignoredGrid=r,this.pitchfactor=Math.cos(e._pitch)*e.cameraToCenterDistance,this.screenRightBoundary=e.width+Yn,this.screenBottomBoundary=e.height+Yn,this.gridRightBoundary=e.width+200,this.gridBottomBoundary=e.height+200,this.fogState=t}placeCollisionBox(e,t,i,r,n,o,s,a){let l=i.projectedAnchorX,c=i.projectedAnchorY,h=i.projectedAnchorZ;const u=i.elevation,d=i.tileID,p=e.getProjection();if(u&&d){const[e,t,r]=p.upVector(d.canonical,i.tileAnchorX,i.tileAnchorY),n=p.upVectorScale(d.canonical,this.transform.center.lat,this.transform.worldSize).metersToTile;l+=e*u*n,c+=t*u*n,h+=r*u*n}const f=this.projectAndGetPerspectiveRatio(s,l,c,h,i.tileID,"globe"===p.name||!!u||this.transform.pitch>0,p),m=o*f.perspectiveRatio,_=(i.x1*t+r.x-i.padding)*m+f.point.x,g=(i.y1*t+r.y-i.padding)*m+f.point.y,y=(i.x2*t+r.x+i.padding)*m+f.point.x,x=(i.y2*t+r.y+i.padding)*m+f.point.y,v=f.perspectiveRatio<=.55||f.occluded;return!this.isInsideGrid(_,g,y,x)||!n&&this.grid.hitTest(_,g,y,x,a)||v?{box:[],offscreen:!1,occluded:f.occluded}:{box:[_,g,y,x],offscreen:this.isOffscreen(_,g,y,x),occluded:!1}}placeCollisionCircles(t,i,r,n,o,s,a,l,c,h,u,d,p,f,m){const _=[],g=this.transform.elevation,y=t.getProjection(),x=g?g.getAtTileOffsetFunc(m,this.transform.center.lat,this.transform.worldSize,y):null,v=new e.P(r.tileAnchorX,r.tileAnchorY);let{x:b,y:w,z:T}=y.projectTilePoint(v.x,v.y,m.canonical);if(x){const[e,t,i]=x(v);b+=e,w+=t,T+=i}const E="globe"===y.name,S=this.projectAndGetPerspectiveRatio(a,b,w,T,m,E||!!g||this.transform.pitch>0,y),{perspectiveRatio:M}=S,A=(u?s/M:s*M)/e.bP,I=Qt(b,w,T,l),C=S.signedDistanceFromCamera>0?ri(A,o,r.lineOffsetX*A,r.lineOffsetY*A,!1,I,v,r,n,l,{},g&&!u?x:null,u&&!!g,y,m,u):null;let P=!1,z=!1,D=!0;if(C&&!S.occluded){const t=.5*p*M+f,r=new e.P(-100,-100),n=new e.P(this.screenRightBoundary,this.screenBottomBoundary),o=new Hn,{first:s,last:a}=C,l=s.path.length;let u=[];for(let e=l-1;e>=1;e--)u.push(s.path[e]);for(let e=1;e(x&&!E&&(i=x(re[3]<=0))&&(u=[]));let g=[];if(u.length>0){let t=1/0,i=-1/0,o=1/0,s=-1/0;for(const e of u)t=Math.min(t,e[0]),o=Math.min(o,e[1]),i=Math.max(i,e[0]),s=Math.max(s,e[1]);i>=r.x&&t<=n.x&&s>=r.y&&o<=n.y&&(g=[u.map((t=>new e.P(t[0],t[1])))],(tn.x||on.y)&&(g=e.cH(g,r.x,r.y,n.x,n.y)))}for(const e of g){o.reset(e,.25*t);let r=0;r=o.length<=.5*t?1:Math.ceil(o.paddedLength/m)+1;for(let e=0;e0){if(e.aB.transformMat4(l,l,t),this.fogState&&o&&"globe"!==a.name){const t=(function(t,i,r,n,o,s){const a=s.calculateFogTileMatrix(o),l=[i,r,n];return e.$.transformMat4(l,l,a),rt(t,e.$.length(l),s.pitch,s._fov)})(this.fogState,i,r,n,o.toUnwrapped(),this.transform);c=t>.9}}else hi(l,l,t);const h=l[3];return{point:new e.P((l[0]/h+1)/2*this.transform.width+Yn,(-l[1]/h+1)/2*this.transform.height+Yn),perspectiveRatio:Math.min(.5+this.transform.getCameraToCenterDistance(a)/h*.5,1.5),signedDistanceFromCamera:h,occluded:s&&l[2]>h||c}}isOffscreen(e,t,i,r){return i=this.screenRightBoundary||rthis.screenBottomBoundary}isInsideGrid(e,t,i,r){return i>=0&&e=0&&te.collisionGroupID===t}}return this.collisionGroups[e]}}function no(t,i,r,n,o){const{horizontalAlign:s,verticalAlign:a}=e.bS(t),l=-(s-.5)*i,c=-(a-.5)*r,h=e.bR(t,n);return new e.P(l+h[0]*o,c+h[1]*o)}function oo(t,i,r,n,o){const s=new e.P(t,i);return r&&s._rotate(n?o:-o),s}class so{constructor(e,t,i,r,n,o){this.transform=e.clone(),this.projection=e.projection.name,this.collisionIndex=new Jn(this.transform,n),this.buildingIndex=o,this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=t,this.retainedQueryData={},this.collisionGroups=new ro(i),this.collisionCircleArrays={},this.prevPlacement=r,r&&(r.prevPlacement=void 0),this.placedOrientations={}}getBucketParts(t,i,r,n){const o=r.getBucket(i),s=r.latestFeatureIndex;if(!o||!s||i.fqid!==o.layerIds[0])return;const a=o.layers[0].layout,l=r.collisionBoxArray,c=Math.pow(2,this.transform.zoom-r.tileID.overscaledZ),h=r.tileSize/e.a4,u=r.tileID.toUnwrapped();this.transform.setProjection(o.projection);const d=(p=r.tileID,f=o.getProjection(),m=this.transform,f.name===this.projection?m.calculateProjMatrix(p.toUnwrapped()):xr(m,f,p));var p,f,m;const _="map"===a.get("text-pitch-alignment"),g="map"===a.get("text-rotation-alignment");i.compileFilter();const y=i.dynamicFilter(),x=i.dynamicFilterNeedsFeature(),v=this.transform.calculatePixelsToTileUnitsMatrix(r),b=Jt(d,r.tileID.canonical,_,g,this.transform,o.getProjection(),v);let w=null;if(_){const t=Kt(d,r.tileID.canonical,_,g,this.transform,o.getProjection(),v);w=e.ae.multiply([],this.transform.labelPlaneMatrix,t)}let T=null;y&&r.latestFeatureIndex&&(T={unwrappedTileID:u,dynamicFilter:y,dynamicFilterNeedsFeature:x,featureIndex:r.latestFeatureIndex}),this.retainedQueryData[o.bucketInstanceId]=new io(o.bucketInstanceId,s,o.sourceLayerIndex,o.index,r.tileID);const E={bucket:o,layout:a,posMatrix:d,textLabelPlaneMatrix:b,labelToScreenMatrix:w,clippingData:T,scale:c,textPixelRatio:h,holdingForFade:r.holdingForFade(),collisionBoxArray:l,partiallyEvaluatedTextSize:e.aE(o.textSizeData,this.transform.zoom),partiallyEvaluatedIconSize:e.aE(o.iconSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(o.sourceID)};if(n)for(const e of o.sortKeyRanges){const{sortKey:i,symbolInstanceStart:r,symbolInstanceEnd:n}=e;t.push({sortKey:i,symbolInstanceStart:r,symbolInstanceEnd:n,parameters:E})}else t.push({symbolInstanceStart:0,symbolInstanceEnd:o.symbolInstances.length,parameters:E})}attemptAnchorPlacement(e,t,i,r,n,o,s,a,l,c,h,u,d,p,f,m,_,g){const{textOffset0:y,textOffset1:x,crossTileID:v}=u,b=[y,x],w=no(e,i,r,b,n),T=this.collisionIndex.placeCollisionBox(p,n,t,oo(w.x,w.y,o,s,this.transform.angle),h,a,l,c.predicate);if(m){const e=p.getSymbolInstanceIconSize(g,this.transform.zoom,u.placedIconSymbolIndex);if(0===this.collisionIndex.placeCollisionBox(p,e,m,oo(w.x,w.y,o,s,this.transform.angle),h,a,l,c.predicate).box.length)return}if(T.box.length>0){let t;return this.prevPlacement&&this.prevPlacement.variableOffsets[v]&&this.prevPlacement.placements[v]&&this.prevPlacement.placements[v].text&&(t=this.prevPlacement.variableOffsets[v].anchor),this.variableOffsets[v]={textOffset:b,width:i,height:r,anchor:e,textScale:n,prevAnchor:t},this.markUsedJustification(p,e,u,f),p.allowVerticalPlacement&&(this.markUsedOrientation(p,f,u),this.placedOrientations[v]=f),{shift:w,placedGlyphBoxes:T}}}placeLayerBucketPart(t,i,r,n){const{bucket:o,layout:s,posMatrix:a,textLabelPlaneMatrix:l,labelToScreenMatrix:c,clippingData:h,textPixelRatio:u,holdingForFade:d,collisionBoxArray:p,partiallyEvaluatedTextSize:f,partiallyEvaluatedIconSize:m,collisionGroup:_}=t.parameters,g=s.get("text-optional"),y=s.get("icon-optional"),x=s.get("text-allow-overlap"),v=s.get("icon-allow-overlap"),b="map"===s.get("text-rotation-alignment"),w="map"===s.get("text-pitch-alignment"),T="viewport-y"===s.get("symbol-z-order"),E=s.get("symbol-z-elevate");this.transform.setProjection(o.projection);let S=x&&(v||!o.hasIconData()||y),M=v&&(x||!o.hasTextData()||g);!o.collisionArrays&&p&&o.deserializeCollisionBoxes(p),r&&n&&o.updateCollisionDebugBuffers(this.transform.zoom,p);const A=(t,n,p)=>{const{crossTileID:T,numVerticalGlyphVertices:E}=t;if(h){const r={zoom:this.transform.zoom,pitch:this.transform.pitch};let n=null;if(h.dynamicFilterNeedsFeature){const e=this.retainedQueryData[o.bucketInstanceId];n=h.featureIndex.loadFeature({featureIndex:t.featureIndex,bucketIndex:e.bucketIndex,sourceLayerIndex:e.sourceLayerIndex,layoutVertexArrayOffset:0})}if(!(0,h.dynamicFilter)(r,n,this.retainedQueryData[o.bucketInstanceId].tileID.canonical,new e.P(t.tileAnchorX,t.tileAnchorY),this.transform.calculateDistanceTileData(h.unwrappedTileID)))return this.placements[T]=new eo(!1,!1,!1,!0),void i.add(T)}if(i.has(T))return;if(d)return void(this.placements[T]=new eo(!1,!1,!1));let A=!1,I=!1,C=!0,P=!1,z=!1,D=null,R={box:null,offscreen:null,occluded:null},L={box:null,offscreen:null,occluded:null},k=null,O=null,B=null,F=0,N=0,V=0;p.textFeatureIndex?F=p.textFeatureIndex:t.useRuntimeCollisionCircles&&(F=t.featureIndex),p.verticalTextFeatureIndex&&(N=p.verticalTextFeatureIndex);const U=e=>{e.tileID=this.retainedQueryData[o.bucketInstanceId].tileID;const i=this.transform.elevation;e.elevation=t.zOffset+(i?i.getAtTileOffset(e.tileID,e.tileAnchorX,e.tileAnchorY):0)},j=p.textBox;if(j){U(j);const i=i=>{let r=e.aF.horizontal;if(o.allowVerticalPlacement&&!i&&this.prevPlacement){const e=this.prevPlacement.placedOrientations[T];e&&(this.placedOrientations[T]=e,r=e,this.markUsedOrientation(o,r,t))}return r},r=(t,i)=>{if(o.allowVerticalPlacement&&E>0&&p.verticalTextBox){for(const r of o.writingModes)if(r===e.aF.vertical?(R=i(),L=R):R=t(),R&&R.box&&R.box.length)break}else R=t()};if(s.get("text-variable-anchor")){let l=s.get("text-variable-anchor");if(this.prevPlacement&&this.prevPlacement.variableOffsets[T]){const e=this.prevPlacement.variableOffsets[T];l.indexOf(e.anchor)>0&&(l=l.filter((t=>t!==e.anchor)),l.unshift(e.anchor))}const c=(e,i,r)=>{const s=o.getSymbolInstanceTextSize(f,t,this.transform.zoom,n),c=(e.x2-e.x1)*s+2*e.padding,h=(e.y2-e.y1)*s+2*e.padding,d=t.hasIconTextFit&&!v?i:null;d&&U(d);let p={box:[],offscreen:!1,occluded:!1};const g=x?2*l.length:l.length;for(let i=0;i=l.length,t,n,o,r,d,f,m);if(g&&(p=g.placedGlyphBoxes,p&&p.box&&p.box.length)){A=!0,D=g.shift;break}}return p};r((()=>c(j,p.iconBox,e.aF.horizontal)),(()=>{const t=p.verticalTextBox;return t&&U(t),o.allowVerticalPlacement&&!(R&&R.box&&R.box.length)&&E>0&&t?c(t,p.verticalIconBox,e.aF.vertical):{box:null,offscreen:null,occluded:null}})),R&&(A=R.box,C=R.offscreen,P=R.occluded);const h=i(!(!R||!R.box));if(!A&&this.prevPlacement){const e=this.prevPlacement.variableOffsets[T];e&&(this.variableOffsets[T]=e,this.markUsedJustification(o,e.anchor,t,h))}}else{const s=(i,r)=>{const s=o.getSymbolInstanceTextSize(f,t,this.transform.zoom,n),l=this.collisionIndex.placeCollisionBox(o,s,i,new e.P(0,0),x,u,a,_.predicate);return l&&l.box&&l.box.length&&(this.markUsedOrientation(o,r,t),this.placedOrientations[T]=r),l};r((()=>s(j,e.aF.horizontal)),(()=>{const t=p.verticalTextBox;return o.allowVerticalPlacement&&E>0&&t?(U(t),s(t,e.aF.vertical)):{box:null,offscreen:null,occluded:null}})),i(!!(R&&R.box&&R.box.length))}}if(k=R,A=k&&k.box&&k.box.length>0,C=k&&k.offscreen,P=k&&k.occluded,t.useRuntimeCollisionCircles){const i=o.text.placedSymbolArray.get(t.centerJustifiedTextSymbolIndex>=0?t.centerJustifiedTextSymbolIndex:t.verticalPlacedTextSymbolIndex),n=e.aG(o.textSizeData,f,i),h=s.get("text-padding");O=this.collisionIndex.placeCollisionCircles(o,x,i,o.lineVertexArray,o.glyphOffsetArray,n,a,l,c,r,w,_.predicate,t.collisionCircleDiameter*n/e.bP,h,this.retainedQueryData[o.bucketInstanceId].tileID),A=x||O.circles.length>0&&!O.collisionDetected,C=C&&O.offscreen,P=O.occluded}if(p.iconFeatureIndex&&(V=p.iconFeatureIndex),p.iconBox){const i=i=>{U(i);const r=t.hasIconTextFit&&D?oo(D.x,D.y,b,w,this.transform.angle):new e.P(0,0),n=o.getSymbolInstanceIconSize(m,this.transform.zoom,t.placedIconSymbolIndex);return this.collisionIndex.placeCollisionBox(o,n,i,r,v,u,a,_.predicate)};L&&L.box&&L.box.length&&p.verticalIconBox?(B=i(p.verticalIconBox),I=B.box.length>0):(B=i(p.iconBox),I=B.box.length>0),C=C&&B.offscreen,z=B.occluded}const $=g||0===t.numHorizontalGlyphVertices&&0===E,G=y||0===t.numIconVertices;if($||G?G?$||(I=I&&A):A=I&&A:I=A=I&&A,A&&k&&k.box&&this.collisionIndex.insertCollisionBox(k.box,s.get("text-ignore-placement"),o.bucketInstanceId,L&&L.box&&N?N:F,_.ID),I&&B&&this.collisionIndex.insertCollisionBox(B.box,s.get("icon-ignore-placement"),o.bucketInstanceId,V,_.ID),O&&(A&&this.collisionIndex.insertCollisionCircles(O.circles,s.get("text-ignore-placement"),o.bucketInstanceId,F,_.ID),r)){const e=o.bucketInstanceId;let t=this.collisionCircleArrays[e];void 0===t&&(t=this.collisionCircleArrays[e]=new to);for(let e=0;e=0;--e){const i=t[e];A(o.symbolInstances.get(i),i,o.collisionArrays[i])}o.hasAnyZOffset&&e.w(`${o.layerIds[0]} layer symbol-z-elevate: symbols are not sorted by elevation if symbol-z-order is evaluated to viewport-y`)}else if(o.hasAnyZOffset){const e=o.getSortedIndexesByZOffset();for(let t=0;t=0&&(t.text.placedSymbolArray.get(o).crossTileID=u>=0&&o!==u?0:c),s>=0&&(t.text.placedSymbolArray.get(s).crossTileID=u>=0&&s!==u?0:c),a>=0&&(t.text.placedSymbolArray.get(a).crossTileID=u>=0&&a!==u?0:c),l>=0&&(t.text.placedSymbolArray.get(l).crossTileID=u>=0&&l!==u?0:c)}markUsedOrientation(t,i,r){const n=i===e.aF.horizontal||i===e.aF.horizontalOnly?i:0,o=i===e.aF.vertical?i:0,{leftJustifiedTextSymbolIndex:s,centerJustifiedTextSymbolIndex:a,rightJustifiedTextSymbolIndex:l,verticalPlacedTextSymbolIndex:c}=r,h=t.text.placedSymbolArray;s>=0&&(h.get(s).placedOrientation=n),a>=0&&(h.get(a).placedOrientation=n),l>=0&&(h.get(l).placedOrientation=n),c>=0&&(h.get(c).placedOrientation=o)}commit(e){this.commitTime=e,this.zoomAtLastRecencyCheck=this.transform.zoom;const t=this.prevPlacement;let i=!1;this.prevZoomAdjustment=t?t.zoomAdjustment(this.transform.zoom):0;const r=t?t.symbolFadeChange(e):1,n=t?t.opacities:{},o=t?t.variableOffsets:{},s=t?t.placedOrientations:{};for(const e in this.placements){const t=this.placements[e],o=n[e];o?(this.opacities[e]=new Qn(o,r,t.text,t.icon,null,t.clipped),i=i||t.text!==o.text.placed||t.icon!==o.icon.placed):(this.opacities[e]=new Qn(null,r,t.text,t.icon,t.skipFade,t.clipped),i=i||t.text||t.icon)}for(const e in n){const t=n[e];if(!this.opacities[e]){const n=new Qn(t,r,!1,!1);n.isHidden()||(this.opacities[e]=n,i=i||t.text.placed||t.icon.placed)}}for(const e in o)this.variableOffsets[e]||!this.opacities[e]||this.opacities[e].isHidden()||(this.variableOffsets[e]=o[e]);for(const e in s)this.placedOrientations[e]||!this.opacities[e]||this.opacities[e].isHidden()||(this.placedOrientations[e]=s[e]);i?this.lastPlacementChangeTime=e:"number"!=typeof this.lastPlacementChangeTime&&(this.lastPlacementChangeTime=t?t.lastPlacementChangeTime:e)}updateLayerOpacities(e,t,i,r){const n=new Set;for(const o of t){const t=o.getBucket(e);t&&o.latestFeatureIndex&&e.fqid===t.layerIds[0]&&(this.updateBucketOpacities(t,n,o.collisionBoxArray,i,r,o.tileID,e.scope),t.layers[0].layout.get("symbol-z-elevate")&&this.buildingIndex&&(this.buildingIndex.updateZOffset(t,o.tileID),t.updateZOffset()))}}updateBucketOpacities(t,i,r,n,o,s,a){t.hasTextData()&&t.text.opacityVertexArray.clear(),t.hasIconData()&&t.icon.opacityVertexArray.clear(),t.hasIconCollisionBoxData()&&t.iconCollisionBox.collisionVertexArray.clear(),t.hasTextCollisionBoxData()&&t.textCollisionBox.collisionVertexArray.clear();const l=t.layers[0].layout,c=!!t.layers[0].dynamicFilter(),h=new Qn(null,0,!1,!1,!0),u=l.get("text-allow-overlap"),d=l.get("icon-allow-overlap"),p=l.get("text-variable-anchor"),f="map"===l.get("text-rotation-alignment"),m="map"===l.get("text-pitch-alignment"),_=new Qn(null,0,u&&(d||!t.hasIconData()||l.get("icon-optional")),d&&(u||!t.hasTextData()||l.get("text-optional")),!0);!t.collisionArrays&&r&&(t.hasIconCollisionBoxData()||t.hasTextCollisionBoxData())&&t.deserializeCollisionBoxes(r);const g=(e,t,i)=>{for(let r=0;r0||d>0,M=v>0,A=this.placedOrientations[x],I=A===e.aF.vertical,C=A===e.aF.horizontal||A===e.aF.horizontalOnly;!S&&!M||E.isHidden()||y++;let P=!1;if((S||M)&&o)for(const i of t.activeReplacements){if(e.cJ(i,n,e.cw.Symbol,a))continue;if(i.min.x>b||b>i.max.x||i.min.y>w||w>i.max.y)continue;const t=e.cK(b,w,s.canonical,i.footprintTileId.canonical);if(P=e.cL(t,i),P)break}if(S){const e=P?go:_o(E.text);g(t.text,u,I?go:e),g(t.text,d,C?go:e);const i=E.text.isHidden(),{leftJustifiedTextSymbolIndex:r,centerJustifiedTextSymbolIndex:n,rightJustifiedTextSymbolIndex:o,verticalPlacedTextSymbolIndex:s}=l,a=t.text.placedSymbolArray,c=i||I?1:0;r>=0&&(a.get(r).hidden=c),n>=0&&(a.get(n).hidden=c),o>=0&&(a.get(o).hidden=c),s>=0&&(a.get(s).hidden=i||C?1:0);const h=this.variableOffsets[x];h&&this.markUsedJustification(t,h.anchor,l,A);const p=this.placedOrientations[x];p&&(this.markUsedJustification(t,"left",l,p),this.markUsedOrientation(t,p,l))}if(M){const e=P?go:_o(E.icon),{placedIconSymbolIndex:i,verticalPlacedIconSymbolIndex:r}=l,n=t.icon.placedSymbolArray,o=E.icon.isHidden()?1:0;i>=0&&(g(t.icon,v,I?go:e),n.get(i).hidden=o),r>=0&&(g(t.icon,l.numVerticalIconVertices,C?go:e),n.get(r).hidden=o)}if(t.hasIconCollisionBoxData()||t.hasTextCollisionBoxData()){const i=t.collisionArrays[r];if(i){let r=new e.P(0,0),n=!0;if(i.textBox||i.verticalTextBox){if(p){const e=this.variableOffsets[x];e?(r=no(e.anchor,e.width,e.height,e.textOffset,e.textScale),f&&r._rotate(m?this.transform.angle:-this.transform.angle)):n=!1}c&&(n=!E.clipped),i.textBox&&ao(t.textCollisionBox.collisionVertexArray,E.text.placed,!n||I,r.x,r.y),i.verticalTextBox&&ao(t.textCollisionBox.collisionVertexArray,E.text.placed,!n||C,r.x,r.y)}const o=n&&Boolean(!C&&i.verticalIconBox);i.iconBox&&ao(t.iconCollisionBox.collisionVertexArray,E.icon.placed,o,l.hasIconTextFit?r.x:0,l.hasIconTextFit?r.y:0),i.verticalIconBox&&ao(t.iconCollisionBox.collisionVertexArray,E.icon.placed,!o,l.hasIconTextFit?r.x:0,l.hasIconTextFit?r.y:0)}}}if(t.fullyClipped=0===y,t.sortFeatures(this.transform.angle),this.retainedQueryData[t.bucketInstanceId]&&(this.retainedQueryData[t.bucketInstanceId].featureSortOrder=t.featureSortOrder),t.hasTextData()&&t.text.opacityVertexBuffer&&t.text.opacityVertexBuffer.updateData(t.text.opacityVertexArray),t.hasIconData()&&t.icon.opacityVertexBuffer&&t.icon.opacityVertexBuffer.updateData(t.icon.opacityVertexArray),t.hasIconCollisionBoxData()&&t.iconCollisionBox.collisionVertexBuffer&&t.iconCollisionBox.collisionVertexBuffer.updateData(t.iconCollisionBox.collisionVertexArray),t.hasTextCollisionBoxData()&&t.textCollisionBox.collisionVertexBuffer&&t.textCollisionBox.collisionVertexBuffer.updateData(t.textCollisionBox.collisionVertexArray),t.bucketInstanceId in this.collisionCircleArrays){const e=this.collisionCircleArrays[t.bucketInstanceId];t.placementInvProjMatrix=e.invProjMatrix,t.placementViewportMatrix=e.viewportMatrix,t.collisionCircleArray=e.circles,delete this.collisionCircleArrays[t.bucketInstanceId]}}symbolFadeChange(e){return 0===this.fadeDuration?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.lastPlacementChangeTimee}setStale(){this.stale=!0}}function ao(e,t,i,r,n){e.emplaceBack(t?1:0,i?1:0,r||0,n||0),e.emplaceBack(t?1:0,i?1:0,r||0,n||0),e.emplaceBack(t?1:0,i?1:0,r||0,n||0),e.emplaceBack(t?1:0,i?1:0,r||0,n||0)}const lo=Math.pow(2,25),co=Math.pow(2,24),ho=Math.pow(2,17),uo=Math.pow(2,16),po=Math.pow(2,9),fo=Math.pow(2,8),mo=Math.pow(2,1);function _o(e){if(0===e.opacity&&!e.placed)return 0;if(1===e.opacity&&e.placed)return 4294967295;const t=e.placed?1:0,i=Math.floor(127*e.opacity);return i*lo+t*co+i*ho+t*uo+i*po+t*fo+i*mo+t}const go=0;class yo{constructor(e){this._sortAcrossTiles="viewport-y"!==e.layout.get("symbol-z-order")&&void 0!==e.layout.get("symbol-sort-key").constantOr(1),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs=new Set,this._bucketParts=[]}continuePlacement(e,t,i,r,n){const o=this._bucketParts;for(;this._currentTileIndexe.sortKey-t.sortKey)));this._currentPartIndex{const t=e.e.now()-o;return!this._forceFullPlacement&&t>2};for(;this._currentPlacementIndex>=0;){const o=i[t[this._currentPlacementIndex]],a=this.placement.collisionIndex.transform.zoom;if("symbol"===o.type&&(!o.minzoom||o.minzoom<=a)&&(!o.maxzoom||o.maxzoom>a)){const t=o,i=t.layout.get("symbol-z-elevate"),a=this._inProgressLayer=this._inProgressLayer||new yo(t),l=e.am(o.source,o.scope);if(a.continuePlacement(i?n[l]:r[l],this.placement,this._showCollisionBoxes,o,s))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(e){return this.placement.commit(e),this.placement}}const vo=512/e.a4/2;class bo{constructor(t,i,r){this.tileID=t,this.bucketInstanceId=r,this.index=new e.cN(i.length,16,Int32Array),this.keys=[],this.crossTileIDs=[];const n=t.canonical.x*e.a4,o=t.canonical.y*e.a4;for(let e=0;ee.overscaledZ)for(const i in n){const o=n[i];o.tileID.isChildOf(e)&&o.findMatches(t.symbolInstances,e,r)}else{const o=n[e.scaledTo(Number(i)).key];o&&o.findMatches(t.symbolInstances,e,r)}}for(let e=0;e{t[e]=!0}));for(const e in this.layerIndexes)t[e]||delete this.layerIndexes[e]}}const So=new e.U({data:new e.W(e.N.colorTheme.data)}),Mo=(e,t)=>Xe(e,t&&t.filter((e=>"source.canvas"!==e.identifier))),Ao=e.ai(Vn,["addLayer","removeLayer","setLights","setPaintProperty","setLayoutProperty","setSlot","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData","setTerrain","setFog","setProjection","setCamera","addImport","removeImport","updateImport"]),Io=e.ai(Vn,["setCenter","setZoom","setBearing","setPitch"]),Co={version:8,layers:[],sources:{}},Po={duration:300,delay:0};class zo extends e.E{constructor(t,i={}){super(),this.map=t,this.scope=i.scope||"",this.globalId=null,this.fragments=[],this.importDepth=i.importDepth||0,this.importsCache=i.importsCache||new Map,this.resolvedImports=i.resolvedImports||new Set,this.transition=e.Q({},Po),this._buildingIndex=new Bn(this),this.crossTileSymbolIndex=new Eo,this._mergedOrder=[],this._drapedFirstOrder=[],this._mergedLayers={},this._mergedSourceCaches={},this._mergedOtherSourceCaches={},this._mergedSymbolSourceCaches={},this._clipLayerIndices=[],this._has3DLayers=!1,this._hasCircleLayers=!1,this._hasSymbolLayers=!1,this._changes=i.styleChanges||new v,this.dispatcher=i.dispatcher?i.dispatcher:new e.by(e.bz(),this),i.imageManager?this.imageManager=i.imageManager:(this.imageManager=new ue,this.imageManager.setEventedParent(this)),this.imageManager.createScope(this.scope),this.glyphManager=i.glyphManager?i.glyphManager:new e.cP(t._requestManager,i.localFontFamily?e.cQ.all:i.localIdeographFontFamily?e.cQ.ideographs:e.cQ.none,i.localFontFamily||i.localIdeographFontFamily),i.modelManager?this.modelManager=i.modelManager:(this.modelManager=new ce(t._requestManager),this.modelManager.setEventedParent(this)),this._layers={},this._serializedLayers={},this._sourceCaches={},this._otherSourceCaches={},this._symbolSourceCaches={},this._loaded=!1,this._precompileDone=!1,this._shouldPrecompile=!1,this._availableImages=[],this._order=[],this._markersNeedUpdate=!1,this._styleColorTheme={lut:null,lutLoading:!1,lutLoadingCorrelationID:0,colorTheme:null},this._styleColorThemeForScope={},this.options=i.configOptions?i.configOptions:new Map,this._configDependentLayers=i.configDependentLayers?i.configDependentLayers:new Set,this._config=i.config,this._initialConfig=i.initialConfig,this.dispatcher.broadcast("setReferrer",e.cR());const r=this;this._rtlTextPluginCallback=zo.registerForPluginStateChange((t=>{r.dispatcher.broadcast("syncRTLPluginState",{pluginStatus:t.pluginStatus,pluginURL:t.pluginURL},((t,i)=>{if(e.cS(t),i&&i.every((e=>e)))for(const e in r._sourceCaches){const t=r._sourceCaches[e],i=t.getSource().type;"vector"!==i&&"geojson"!==i||t.reload()}}))})),this.on("data",(e=>{if("source"!==e.dataType||"metadata"!==e.sourceDataType)return;const t=this.getOwnSource(e.sourceId);if(t&&t.vectorLayerIds)for(const e in this._layers){const i=this._layers[e];i.source===t.id&&this._validateLayer(i)}}))}load(e){return e?("string"==typeof e?this.loadURL(e):this.loadJSON(e),this):this}_getGlobalId(t){if(!t)return null;if("string"==typeof t){if(e.cT(t))return t;const i=e.cU(t);if(!i.startsWith("http"))try{return new URL(i,location.href).toString()}catch(e){return i}return i}return`json://${e.cV(JSON.stringify(t))}`}_diffStyle(t,i,r){this.globalId=this._getGlobalId(t);const n=(e,t)=>{try{t(null,this.setState(e,r))}catch(e){t(e,!1)}};if("string"==typeof t){const r=this.map._requestManager.normalizeStyleURL(t),o=this.map._requestManager.transformRequest(r,e.R.Style);e.h(o,((t,r)=>{t?this.fire(new e.f(t)):r&&n(r,i)}))}else"object"==typeof t&&n(t,i)}loadURL(t,i={}){this.fire(new e.g("dataloading",{dataType:"style"}));const r="boolean"==typeof i.validate?i.validate:!e.cT(t);this.globalId=this._getGlobalId(t),t=this.map._requestManager.normalizeStyleURL(t,i.accessToken),this.resolvedImports.add(t);const n=this.importsCache.get(t);if(n)return this._load(n,r);const o=this.map._requestManager.transformRequest(t,e.R.Style);this._request=e.h(o,((i,n)=>{if(this._request=null,i)this.fire(new e.f(i));else if(n)return this.importsCache.set(t,n),this._load(n,r)}))}loadJSON(t,i={}){this.fire(new e.g("dataloading",{dataType:"style"})),this.globalId=this._getGlobalId(t),this._request=e.e.frame((()=>{this._request=null,this._load(t,!1!==i.validate)}))}loadEmpty(){this.fire(new e.g("dataloading",{dataType:"style"})),this._load(Co,!1)}_loadImports(t,i,r){if(this.importDepth>=4)return e.w("Style doesn't support nesting deeper than 5"),Promise.resolve();const n=[];for(const e of t){const t=this._createFragmentStyle(e),o=new Promise((e=>{t.once("style.import.load",e),t.once("error",e)})).then((()=>this.mergeAll()));if(n.push(o),this.resolvedImports.has(e.url)){t.loadEmpty();continue}const s=e.data||this.importsCache.get(e.url);s?(t.loadJSON(s,{validate:i}),this._isInternalStyle(s)&&(t.globalId=null)):e.url?t.loadURL(e.url,{validate:i}):t.loadEmpty();const a={style:t,id:e.id,config:e.config};if(r){const e=this.fragments.findIndex((({id:e})=>e===r));this.fragments=this.fragments.slice(0,e).concat(a).concat(this.fragments.slice(e))}else this.fragments.push(a)}return Promise.allSettled(n)}getImportGlobalIds(e=this,t=new Set){for(const i of e.fragments)i.style.globalId&&t.add(i.style.globalId),this.getImportGlobalIds(i.style,t);return[...t.values()]}_createFragmentStyle(t){const i=this.scope?e.am(t.id,this.scope):t.id;let r;const n=this._initialConfig&&this._initialConfig[i];(t.config||n)&&(r=e.Q({},t.config,n));const o=new zo(this.map,{scope:i,styleChanges:this._changes,importDepth:this.importDepth+1,importsCache:this.importsCache,resolvedImports:new Set(this.resolvedImports),dispatcher:this.dispatcher,imageManager:this.imageManager,glyphManager:this.glyphManager,modelManager:this.modelManager,config:r,configOptions:this.options,configDependentLayers:this._configDependentLayers});return o.setEventedParent(this.map,{style:o}),o}_reloadImports(){this.mergeAll(),this._updateMapProjection(),this.updateConfigDependencies(),this.map._triggerCameraUpdate(this.camera),this.dispatcher.broadcast("setLayers",{layers:this._serializeLayers(this._order),scope:this.scope,options:this.options}),this._shouldPrecompile=this.map._precompilePrograms&&this.isRootStyle()}_isInternalStyle(e){return this.isRootStyle()&&(e.fragment||!!e.schema&&!1!==e.fragment)}_load(t,i){const r=t.schema;if(this._isInternalStyle(t)){const r=e.Q({},Co,{imports:[{id:"basemap",data:t,url:""}]});return void this._load(r,i)}if(this.updateConfig(this._config,r),i&&Mo(this,Be(t)))return;this._loaded=!0,this.stylesheet=e.cW(t);const n=()=>{for(const e in t.sources)this.addSource(e,t.sources[e],{validate:!1,isInitialLoad:!0});t.sprite?this._loadSprite(t.sprite):(this.imageManager.setLoaded(!0,this.scope),this.dispatcher.broadcast("spriteLoaded",{scope:this.scope,isLoaded:!0})),this.glyphManager.setURL(t.glyphs,this.scope);const r=Nn(this.stylesheet.layers);if(this._order=r.map((e=>e.id)),this.stylesheet.light&&e.w("The `light` root property is deprecated, prefer using `lights` with `flat` light type instead."),this.stylesheet.lights)if(1===this.stylesheet.lights.length&&"flat"===this.stylesheet.lights[0].type){const e=this.stylesheet.lights[0];this.light=new Je(e.properties,e.id)}else this.setLights(this.stylesheet.lights);this.light||(this.light=new Je(this.stylesheet.light)),this._layers={},this._serializedLayers={};for(const t of r){const i=e.c$(t,this.scope,this._styleColorTheme.lut,this.options);0!==i.configDependencies.size&&this._configDependentLayers.add(i.fqid),i.setEventedParent(this,{layer:{id:i.id}}),this._layers[i.id]=i,this._serializedLayers[i.id]=i.serialize();const r=this.getOwnLayerSourceCache(i),n=!!this.directionalLight&&this.directionalLight.shadowsEnabled();r&&i.canCastShadows()&&n&&(r.castsShadows=!0)}this.stylesheet.models&&this.modelManager.addModels(this.stylesheet.models,this.scope);const n=this.stylesheet.terrain;n&&(this.checkCanvasFingerprintNoise(),this.disableElevatedTerrain||this.terrainSetForDrapingOnly()||this._createTerrain(n,1)),this.stylesheet.fog&&this._createFog(this.stylesheet.fog),this.stylesheet.transition&&this.setTransition(this.stylesheet.transition),this.fire(new e.g("data",{dataType:"style"}));const o=this.isRootStyle();t.imports?this._loadImports(t.imports,i).then((()=>{this._reloadImports(),this.fire(new e.g(o?"style.load":"style.import.load"))})):(this._reloadImports(),this.fire(new e.g(o?"style.load":"style.import.load")))},o=this.stylesheet["color-theme"];if(this._styleColorTheme.colorTheme=o,o){const t=this._evaluateColorThemeData(o);this._loadColorTheme(t).then((()=>{n()})).catch((t=>{e.w(`Couldn't load color theme from the stylesheet: ${t}`),n()}))}else this._styleColorTheme.lut=null,n()}isRootStyle(){return 0===this.importDepth}mergeAll(){let t,i,r,n,o,s,a,l;const c={};this.terrain&&this.terrain.scope!==this.scope&&delete this.terrain,this.forEachFragmentStyle((e=>{if(e.stylesheet){if(null!=e.light&&(t=e.light),e.stylesheet.lights)for(const t of e.stylesheet.lights)"ambient"===t.type&&null!=e.ambientLight&&(i=e.ambientLight),"directional"===t.type&&null!=e.directionalLight&&(r=e.directionalLight);n=this._prioritizeTerrain(n,e.terrain,e.stylesheet.terrain),e.stylesheet.fog&&null!=e.fog&&(o=e.fog),null!=e.stylesheet.camera&&(l=e.stylesheet.camera),null!=e.stylesheet.projection&&(s=e.stylesheet.projection),null!=e.stylesheet.transition&&(a=e.stylesheet.transition),c[e.scope]=e._styleColorTheme}})),this.light=t,this.ambientLight=i,this.directionalLight=r,this.fog=o,this._styleColorThemeForScope=c,null===n?delete this.terrain:this.terrain=n,this.camera=l||{"camera-projection":"perspective"},this.projection=s||{name:"mercator"},this.transition=e.Q({},Po,a),this.mergeSources(),this.mergeLayers()}forEachFragmentStyle(e){const t=i=>{for(const e of i.fragments)t(e.style);e(i)};t(this)}_prioritizeTerrain(e,t,i){const r=e&&0===e.drapeRenderMode;return null===i?t&&0===t.drapeRenderMode?t:r?e:null:null!=t&&(!e||r||t&&1===t.drapeRenderMode)?t:e}mergeTerrain(){let e;this.terrain&&this.terrain.scope!==this.scope&&delete this.terrain,this.forEachFragmentStyle((t=>{e=this._prioritizeTerrain(e,t.terrain,t.stylesheet.terrain)})),null===e?delete this.terrain:this.terrain=e}mergeProjection(){let e;this.forEachFragmentStyle((t=>{null!=t.stylesheet.projection&&(e=t.stylesheet.projection)})),this.projection=e||{name:"mercator"}}mergeSources(){const t={},i={},r={};this.forEachFragmentStyle((n=>{for(const i in n._sourceCaches){const r=e.am(i,n.scope);t[r]=n._sourceCaches[i]}for(const t in n._otherSourceCaches){const r=e.am(t,n.scope);i[r]=n._otherSourceCaches[t]}for(const t in n._symbolSourceCaches){const i=e.am(t,n.scope);r[i]=n._symbolSourceCaches[t]}})),this._mergedSourceCaches=t,this._mergedOtherSourceCaches=i,this._mergedSymbolSourceCaches=r}mergeLayers(){const t={},i=[],r={};this._mergedSlots=[],this._has3DLayers=!1,this._hasCircleLayers=!1,this._hasSymbolLayers=!1,this.forEachFragmentStyle((r=>{for(const n of r._order){const o=r._layers[n];if("slot"===o.type){const i=e.cX(n);if(t[i])continue;t[i]=[]}o.slot&&t[o.slot]?t[o.slot].push(o):i.push(o)}})),this._mergedOrder=[],this._clipLayerIndices=[];let n=0;const o=(i=[])=>{for(const s of i)if("slot"===s.type){const i=e.cX(s.id);t[i]&&o(t[i]),this._mergedSlots.push(i)}else{const t=e.am(s.id,s.scope);this._mergedOrder.push(t),r[t]=s,s.is3D()&&(this._has3DLayers=!0),"circle"===s.type&&(this._hasCircleLayers=!0),"symbol"===s.type&&(this._hasSymbolLayers=!0),"clip"===s.type&&this._clipLayerIndices.push(n),n++}};o(i),this._mergedOrder.sort(((e,t)=>{const i=r[e],n=r[t];return i.hasInitialOcclusionOpacityProperties?n.is3D()?1:0:i.is3D()&&n.hasInitialOcclusionOpacityProperties?-1:0})),this._mergedLayers=r,this.updateDrapeFirstLayers(),this._buildingIndex.processLayersChanged()}terrainSetForDrapingOnly(){return!!this.terrain&&0===this.terrain.drapeRenderMode}getCamera(){return this.stylesheet.camera}setCamera(t){return this.stylesheet.camera=e.Q({},this.stylesheet.camera,t),this.camera=this.stylesheet.camera,this}_evaluateColorThemeData(t){return t.data?(function(t,i,r){const n=e.Q({},i);for(const t of Object.keys(e.N.colorTheme))void 0===n[t]&&(n[t]=e.N.colorTheme[t].default);const o=new e.O(So,t,new Map(r));return o.setTransitionOrValue(n,r),o.untransitioned().possiblyEvaluate(new e.Y(0))})(this.scope,t,this.options).get("data"):null}_loadColorTheme(t){this._styleColorTheme.lutLoading=!0,this._styleColorTheme.lutLoadingCorrelationID+=1;const i=this._styleColorTheme.lutLoadingCorrelationID;return new Promise(((r,n)=>{const o="data:image/png;base64,";if(!t||0===t.length)return this._styleColorTheme.lut=null,this._styleColorTheme.lutLoading=!1,void r();let s=t;s.startsWith(o)||(s=o+s);const a="mapbox-reserved-lut",l=new Image;l.src=s,l.onerror=()=>{this._styleColorTheme.lutLoading=!1,n(new Error("Failed to load image data"))},l.onload=()=>{if(this._styleColorTheme.lutLoadingCorrelationID!==i)return void r();this._styleColorTheme.lutLoading=!1;const{width:o,height:s,data:c}=e.e.getImageData(l);if(s>32)return void n(new Error("The height of the image must be less than or equal to 32 pixels."));if(o!==s*s)return void n(new Error("The width of the image must be equal to the height squared."));this.getImage(a)&&this.removeImage(a),this.addImage(a,{data:new e.j({width:o,height:s},c),pixelRatio:1,sdf:!1,version:0});const h=this.imageManager.getImage(a,this.scope);h?(this._styleColorTheme.lut={image:h.data,data:t},r()):n(new Error("Missing LUT image."))}}))}getLut(e){const t=this._styleColorThemeForScope[e];return t?t.lut:null}setProjection(e){e?this.stylesheet.projection=e:delete this.stylesheet.projection,this.mergeProjection(),this._updateMapProjection()}applyProjectionUpdate(){this._loaded&&(this.dispatcher.broadcast("setProjection",this.map.transform.projectionOptions),this.map.transform.projection.requiresDraping?(this.getTerrain()||this.stylesheet.terrain)&&!this.disableElevatedTerrain||this.setTerrainForDraping():this.terrainSetForDrapingOnly()&&this.setTerrain(null,0))}_updateMapProjection(){this.isRootStyle()&&(this.map._useExplicitProjection?this.applyProjectionUpdate():this.map._prioritizeAndUpdateProjection(null,this.projection))}_loadSprite(t){this._spriteRequest=(function(t,i,r){let n,o,s;const a=e.e.devicePixelRatio>1?"@2x":"";let l=e.h(i.transformRequest(i.normalizeSpriteURL(t,a,".json"),e.R.SpriteJSON),((e,t)=>{l=null,s||(s=e,n=t,h())})),c=e.i(i.transformRequest(i.normalizeSpriteURL(t,a,".png"),e.R.SpriteImage),((e,t)=>{c=null,s||(s=e,o=t,h())}));function h(){if(s)r(s);else if(n&&o){const t=e.e.getImageData(o),i={};for(const r in n){const{width:o,height:s,x:a,y:l,sdf:c,pixelRatio:h,stretchX:u,stretchY:d,content:p}=n[r],f=new e.j({width:o,height:s});e.j.copy(t,f,{x:a,y:l},{x:0,y:0},{width:o,height:s},null),i[r]={data:f,pixelRatio:h,sdf:c,stretchX:u,stretchY:d,content:p}}r(null,i)}}return{cancel(){l&&(l.cancel(),l=null),c&&(c.cancel(),c=null)}}})(t,this.map._requestManager,((t,i)=>{if(this._spriteRequest=null,t)this.fire(new e.f(t));else if(i)for(const e in i)this.imageManager.addImage(e,this.scope,i[e]);this.imageManager.setLoaded(!0,this.scope),this._availableImages=this.imageManager.listImages(this.scope),this.dispatcher.broadcast("setImages",{scope:this.scope,images:this._availableImages}),this.dispatcher.broadcast("spriteLoaded",{scope:this.scope,isLoaded:!0}),this.fire(new e.g("data",{dataType:"style"}))}))}_validateLayer(t){const i=this.getOwnSource(t.source);if(!i)return;const r=t.sourceLayer;r&&("geojson"===i.type||i.vectorLayerIds&&-1===i.vectorLayerIds.indexOf(r))&&this.fire(new e.f(new Error(`Source layer "${r}" does not exist on source "${i.id}" as specified by style layer "${t.id}"`)))}loaded(){if(!this._loaded)return!1;if(Object.keys(this._changes.getUpdatedSourceCaches()).length)return!1;for(const e in this._sourceCaches)if(!this._sourceCaches[e].loaded())return!1;if(!this.imageManager.isLoaded())return!1;if(!this.modelManager.isLoaded())return!1;if(this._styleColorTheme.lutLoading)return!1;for(const{style:e}of this.fragments)if(!e.loaded())return!1;return!0}_serializeImports(){if(this.stylesheet.imports)return this.stylesheet.imports.map(((e,t)=>{const i=this.fragments[t];return i&&i.style&&(e.data=i.style.serialize()),e}))}_serializeSources(){const e={};for(const t in this._sourceCaches){const i=this._sourceCaches[t].getSource();e[i.id]||(e[i.id]=i.serialize())}return e}_serializeLayers(e){const t=[];for(const i of e){const e=this._layers[i];e&&"custom"!==e.type&&t.push(e.serialize())}return t}hasLightTransitions(){return!(!this.light||!this.light.hasTransition())||!(!this.ambientLight||!this.ambientLight.hasTransition())||!(!this.directionalLight||!this.directionalLight.hasTransition())}hasFogTransition(){return!!this.fog&&this.fog.hasTransition()}hasTransitions(){if(this.hasLightTransitions())return!0;if(this.hasFogTransition())return!0;for(const e in this._sourceCaches)if(this._sourceCaches[e].hasTransition())return!0;for(const e in this._layers)if(this._layers[e].hasTransition())return!0;return!1}get order(){return this.terrain?this._drapedFirstOrder:this._mergedOrder}isLayerDraped(e){return!!this.terrain&&e.isDraped(this.getLayerSourceCache(e))}_checkLoaded(){if(!this._loaded)throw new Error("Style is not done loading")}_checkLayer(t){const i=this.getOwnLayer(t);if(i)return i;this.fire(new e.f(new Error(`The layer '${t}' does not exist in the map's style.`)))}_checkSource(t){const i=this.getOwnSource(t);if(i)return i;this.fire(new e.f(new Error(`The source '${t}' does not exist in the map's style.`)))}precompilePrograms(e,t){const i=this.map.painter;if(i)for(let r=e.minzoom||0;r<(e.maxzoom||25.5);r++){const r=e.getProgramIds();if(r)for(const n of r){const r=e.getDefaultProgramParams(n,t.zoom,this._styleColorTheme.lut);r&&(i.style=this,this.fog&&(i._fogVisible=!0,r.overrideFog=!0,i.getOrCreateProgram(n,r)),i._fogVisible=!1,r.overrideFog=!1,i.getOrCreateProgram(n,r),(this.stylesheet.terrain||this.stylesheet.projection&&"globe"===this.stylesheet.projection.name)&&(r.overrideRtt=!0,i.getOrCreateProgram(n,r)))}}}update(t){if(!this._loaded)return;this.ambientLight&&this.ambientLight.recalculate(t),this.directionalLight&&this.directionalLight.recalculate(t);const i=this.calculateLightsBrightness();t.brightness=i||0,i!==this._brightness&&(this._brightness=i,this.dispatcher.broadcast("setBrightness",i));const r=this._changes.isDirty();let n=!1;if(this._changes.isDirty()){const e=this._changes.getLayerUpdatesByScope();for(const t in e){const{updatedIds:i,removedIds:r}=e[t];(i||r)&&(this._updateWorkerLayers(t,i,r),n=!0)}this.updateSourceCaches(),this._updateTilesForChangedImages(),this.updateLayers(t),this.light&&this.light.updateTransitions(t),this.ambientLight&&this.ambientLight.updateTransitions(t),this.directionalLight&&this.directionalLight.updateTransitions(t),this.fog&&this.fog.updateTransitions(t),this._changes.reset()}const o={};for(const e in this._mergedSourceCaches){const t=this._mergedSourceCaches[e];o[e]=t.used,t.used=!1,t.tileCoverLift=0}for(const e of this._mergedOrder){const i=this._mergedLayers[e];if(i.recalculate(t,this._availableImages),!i.isHidden(t.zoom)){const e=this.getLayerSourceCache(i);e&&(e.used=!0,e.tileCoverLift=Math.max(e.tileCoverLift,i.tileCoverLift()))}!this._precompileDone&&this._shouldPrecompile&&("requestIdleCallback"in window?requestIdleCallback((()=>{this.precompilePrograms(i,t)})):this.precompilePrograms(i,t))}this._shouldPrecompile&&(this._precompileDone=!0),this.terrain&&n&&this.mergeLayers();for(const t in o){const i=this._mergedSourceCaches[t];o[t]!==i.used&&i.getSource().fire(new e.g("data",{sourceDataType:"visibility",dataType:"source",sourceId:i.getSource().id}))}this.light&&this.light.recalculate(t),this.terrain&&this.terrain.recalculate(t),this.fog&&this.fog.recalculate(t),this.z=t.zoom,this._markersNeedUpdate&&(this._updateMarkersOpacity(),this._markersNeedUpdate=!1),r&&this.fire(new e.g("data",{dataType:"style"}))}_updateTilesForChangedImages(){const e=this._changes.getUpdatedImages();if(e.length){for(const t in this._sourceCaches)this._sourceCaches[t].reloadTilesForDependencies(["icons","patterns"],e);this._changes.resetUpdatedImages()}}_updateWorkerLayers(e,t,i){const r=this.getFragmentStyle(e);r&&this.dispatcher.broadcast("updateLayers",{layers:t?r._serializeLayers(t):[],scope:e,removedIds:i||[],options:r.options})}setState(t,i){if(this._checkLoaded(),Mo(this,Be(t)))return!1;(t=e.cW(t)).layers=Nn(t.layers);const r=(function(t,i){if(!t)return[{command:Vn.setStyle,args:[i]}];let r=[];try{if(!e.d(t.version,i.version))return[{command:Vn.setStyle,args:[i]}];if(e.d(t.center,i.center)||r.push({command:Vn.setCenter,args:[i.center]}),e.d(t.zoom,i.zoom)||r.push({command:Vn.setZoom,args:[i.zoom]}),e.d(t.bearing,i.bearing)||r.push({command:Vn.setBearing,args:[i.bearing]}),e.d(t.pitch,i.pitch)||r.push({command:Vn.setPitch,args:[i.pitch]}),e.d(t.sprite,i.sprite)||r.push({command:Vn.setSprite,args:[i.sprite]}),e.d(t.glyphs,i.glyphs)||r.push({command:Vn.setGlyphs,args:[i.glyphs]}),e.d(t.imports,i.imports)||(function(t=[],i=[],r){i=i||[];const n=(t=t||[]).map(Zn),o=i.map(Zn),s=t.reduce(Wn,{}),a=i.reduce(Wn,{}),l=n.slice();let c,h,u,d;for(c=0,h=0;c{e.source&&n[e.source]?r.push({command:Vn.removeLayer,args:[e.id]}):s.push(e)}));let a=t.terrain;a&&n[a.source]&&(r.push({command:Vn.setTerrain,args:[void 0]}),a=void 0),r=r.concat(o),e.d(a,i.terrain)||r.push({command:Vn.setTerrain,args:[i.terrain]}),(function(t,i,r){i=i||[];const n=(t=t||[]).map(Zn),o=i.map(Zn),s=t.reduce(Wn,{}),a=i.reduce(Wn,{}),l=n.slice(),c=Object.create(null);let h,u,d,p,f,m,_;for(h=0,u=0;h!(e.command in Io)));if(0===r.length)return!1;const n=r.filter((e=>!(e.command in Ao)));if(n.length>0)throw new Error(`Unimplemented: ${n.map((e=>e.command)).join(", ")}.`);const o=[];return r.forEach((e=>{o.push(this[e.command].apply(this,e.args))})),i&&Promise.all(o).then(i),this.stylesheet=t,this.mergeAll(),this.dispatcher.broadcast("setLayers",{layers:this._serializeLayers(this._order),scope:this.scope,options:this.options}),!0}addImage(t,i){return this.getImage(t)?this.fire(new e.f(new Error("An image with this name already exists."))):(this.imageManager.addImage(t,this.scope,i),this._afterImageUpdated(t),this)}updateImage(e,t){this.imageManager.updateImage(e,this.scope,t)}getImage(e){return this.imageManager.getImage(e,this.scope)}removeImage(t){return this.getImage(t)?(this.imageManager.removeImage(t,this.scope),this._afterImageUpdated(t),this):this.fire(new e.f(new Error("No image with this name exists.")))}_afterImageUpdated(t){this._availableImages=this.imageManager.listImages(this.scope),this._changes.updateImage(t),this.dispatcher.broadcast("setImages",{scope:this.scope,images:this._availableImages}),this.fire(new e.g("data",{dataType:"style"}))}listImages(){return this._checkLoaded(),this._availableImages.slice()}addModel(e,t,i={}){return this._checkLoaded(),this._validate(We,`models.${e}`,t,null,i)||(this.modelManager.addModel(e,t,this.scope),this._changes.setDirty()),this}hasModel(e){return this.modelManager.hasModel(e,this.scope)}removeModel(t){return this.hasModel(t)?(this.modelManager.removeModel(t,this.scope),this):this.fire(new e.f(new Error("No model with this ID exists.")))}listModels(){return this._checkLoaded(),this.modelManager.listModels(this.scope)}addSource(t,i,r={}){if(this._checkLoaded(),void 0!==this.getOwnSource(t))throw new Error(`There is already a source with ID "${t}".`);if(!i.type)throw new Error(`The type property must be defined, but only the following properties were given: ${Object.keys(i).join(", ")}.`);if(["vector","raster","geojson","video","image"].indexOf(i.type)>=0&&this._validate(Fe,`sources.${t}`,i,null,r))return;this.map&&this.map._collectResourceTiming&&(i.collectResourceTiming=!0);const n=Ri(t,i,this.dispatcher,this);n.scope=this.scope,n.setEventedParent(this,(()=>({isSourceLoaded:this._isSourceCacheLoaded(n.id),source:n.serialize(),sourceId:n.id})));const o=t=>{const i=(t?"symbol:":"other:")+n.id,r=e.am(i,this.scope),o=this._sourceCaches[i]=new e.bx(r,n,t);(t?this._symbolSourceCaches:this._otherSourceCaches)[n.id]=o,o.onAdd(this.map)};o(!1),"vector"!==i.type&&"geojson"!==i.type||o(!0),n.onAdd&&n.onAdd(this.map),r.isInitialLoad||(this.mergeSources(),this._changes.setDirty())}removeSource(t){this._checkLoaded();const i=this.getOwnSource(t);if(!i)throw new Error("There is no source with this ID");for(const i in this._layers)if(this._layers[i].source===t)return this.fire(new e.f(new Error(`Source "${t}" cannot be removed while layer "${i}" is using it.`)));if(this.terrain&&this.terrain.scope===this.scope&&this.terrain.get().source===t)return this.fire(new e.f(new Error(`Source "${t}" cannot be removed while terrain is using it.`)));const r=this.getOwnSourceCaches(t);for(const t of r){const i=e.cX(t.id);delete this._sourceCaches[i],this._changes.discardSourceCacheUpdate(t.id),t.fire(new e.g("data",{sourceDataType:"metadata",dataType:"source",sourceId:t.getSource().id})),t.setEventedParent(null),t.clearTiles()}return delete this._otherSourceCaches[t],delete this._symbolSourceCaches[t],this.mergeSources(),i.setEventedParent(null),i.onRemove&&i.onRemove(this.map),this._changes.setDirty(),this}setGeoJSONSourceData(e,t){this._checkLoaded(),this.getOwnSource(e).setData(t),this._changes.setDirty()}getOwnSource(e){const t=this.getOwnSourceCache(e);return t&&t.getSource()}getOwnSources(){const e=[];for(const t in this._otherSourceCaches){const i=this.getOwnSourceCache(t);i&&e.push(i.getSource())}return e}areTilesLoaded(){const e=this._mergedSourceCaches;for(const t in e){const i=e[t]._tiles;for(const e in i){const t=i[e];if("loaded"!==t.state&&"errored"!==t.state)return!1}}return!0}setLights(t){if(this._checkLoaded(),!t)return void delete this.ambientLight;const i=this._getTransitionParameters();for(const r of t){if(this._validate(Ve,"lights",r))return;switch(r.type){case"ambient":if(this.ambientLight){const e=this.ambientLight;e.set(r),e.updateTransitions(i)}else this.ambientLight=new ct(r,ht||(ht=new e.U({color:new e.W(e.N.properties_light_ambient.color),intensity:new e.W(e.N.properties_light_ambient.intensity)})),this.scope,this.options);break;case"directional":if(this.directionalLight){const e=this.directionalLight;e.set(r),e.updateTransitions(i)}else this.directionalLight=new ct(r,ut||(ut=new e.U({direction:new e.a6(e.N.properties_light_directional.direction),color:new e.W(e.N.properties_light_directional.color),intensity:new e.W(e.N.properties_light_directional.intensity),"cast-shadows":new e.W(e.N.properties_light_directional["cast-shadows"]),"shadow-intensity":new e.W(e.N.properties_light_directional["shadow-intensity"])})),this.scope,this.options)}}const r=new e.Y(this.z||0,i);this.ambientLight&&this.ambientLight.recalculate(r),this.directionalLight&&this.directionalLight.recalculate(r),this._brightness=this.calculateLightsBrightness(),this.dispatcher.broadcast("setBrightness",this._brightness)}calculateLightsBrightness(){const t=this.directionalLight,i=this.ambientLight;if(!t||!i)return;const r=e=>.2126*(e[0]<=.03928?e[0]/12.92:Math.pow((e[0]+.055)/1.055,2.4))+.7152*(e[1]<=.03928?e[1]/12.92:Math.pow((e[1]+.055)/1.055,2.4))+.0722*(e[2]<=.03928?e[2]/12.92:Math.pow((e[2]+.055)/1.055,2.4)),n=t.properties.get("color").toRenderColor(null).toArray01(),o=t.properties.get("intensity"),s=t.properties.get("direction"),a=1-e.ad(s.x,s.y,s.z)[2]/90,l=r(n)*o*a,c=i.properties.get("color").toRenderColor(null).toArray01(),h=i.properties.get("intensity");return(l+r(c)*h)/2}getBrightness(){return this._brightness}getLights(){if(!this.enable3dLights())return null;const e=[];return this.directionalLight&&e.push(this.directionalLight.get()),this.ambientLight&&e.push(this.ambientLight.get()),e}enable3dLights(){return!!this.ambientLight&&!!this.directionalLight}getFragmentStyle(t){if(!t)return this;if(e.cY(t)){const i=e.cZ(t),r=this.fragments.find((({id:e})=>e===i));if(!r)throw new Error(`Style import not found: ${t}`);const n=e.cX(t);return r.style.getFragmentStyle(n)}{const e=this.fragments.find((({id:e})=>e===t));if(!e)throw new Error(`Style import not found: ${t}`);return e.style}}getConfigProperty(t,i){const r=this.getFragmentStyle(t);if(!r)return null;const n=e.am(i,r.scope),o=r.options.get(n),s=o?o.value||o.default:null;return s?s.serialize():null}setConfigProperty(t,i,r){const n=this.getFragmentStyle(t);if(!n)return;const o=n.stylesheet.schema;if(!o||!o[i])return;const s=e.z(r);if("success"!==s.result)return void Mo(this,s.value);const a=s.value.expression,l=e.am(i,n.scope),c=n.options.get(l);if(!c)return;let h;const{minValue:u,maxValue:d,stepValue:p,type:f,values:m}=o[i],_=e.z(o[i].default);"success"===_.result&&(h=_.value.expression),h?(this.options.set(l,Object.assign({},c,{value:a,default:h,minValue:u,maxValue:d,stepValue:p,type:f,values:m})),this.updateConfigDependencies(i)):this.fire(new e.f(new Error(`No schema defined for the config option "${i}" in the "${t}" fragment.`)))}getConfig(t){const i=this.getFragmentStyle(t);if(!i)return null;const r=i.stylesheet.schema;if(!r)return null;const n={};for(const t in r){const r=e.am(t,i.scope),o=i.options.get(r),s=o?o.value||o.default:null;n[t]=s?s.serialize():null}return n}setConfig(e,t){const i=this.getFragmentStyle(e);i&&(i.updateConfig(t,i.stylesheet.schema),this.updateConfigDependencies())}getSchema(e){const t=this.getFragmentStyle(e);return t?t.stylesheet.schema:null}setSchema(e,t){const i=this.getFragmentStyle(e);i&&(i.stylesheet.schema=t,i.updateConfig(i._config,t),this.updateConfigDependencies())}updateConfig(t,i){if(this._config=t,t||i)if(i)for(const r in i){let n,o;const s=e.z(i[r].default);if("success"===s.result&&(n=s.value.expression),t&&void 0!==t[r]){const i=e.z(t[r]);"success"===i.result&&(o=i.value.expression)}const{minValue:a,maxValue:l,stepValue:c,type:h,values:u}=i[r];if(n){const t=e.am(r,this.scope);this.options.set(t,{default:n,value:o,minValue:a,maxValue:l,stepValue:c,type:h,values:u})}else this.fire(new e.f(new Error(`No schema defined for config option "${r}".`)))}else this.fire(new e.f(new Error("Attempting to set config for a style without schema.")))}updateConfigDependencies(e){for(const t of this._configDependentLayers){const i=this.getLayer(t);if(i){if(e&&!i.configDependencies.has(e))continue;i.possiblyEvaluateVisibility(),this._updateLayer(i)}}this.ambientLight&&this.ambientLight.updateConfig(this.options),this.directionalLight&&this.directionalLight.updateConfig(this.options),this.fog&&this.fog.updateConfig(this.options),this.forEachFragmentStyle((e=>{if(e._styleColorTheme.colorTheme){const t=e._evaluateColorThemeData(e._styleColorTheme.colorTheme);(!e._styleColorTheme.lut&&""!==t||e._styleColorTheme.lut&&t!==e._styleColorTheme.lut.data)&&e.setColorTheme(e._styleColorTheme.colorTheme)}})),this._changes.setDirty()}addLayer(t,i,r={}){this._checkLoaded();const n=t.id;if(this._layers[n])return void this.fire(new e.f(new Error(`Layer with id "${n}" already exists on this map`)));let o;if("custom"===t.type){if(Mo(this,e.c_(t)))return;o=e.c$(t,this.scope,this._styleColorTheme.lut,this.options)}else{if("object"==typeof t.source&&(this.addSource(n,t.source),t=e.cW(t),t=e.Q(t,{source:n})),this._validate($e,`layers.${n}`,t,{arrayIndex:-1},r))return;o=e.c$(t,this.scope,this._styleColorTheme.lut,this.options),this._validateLayer(o),o.setEventedParent(this,{layer:{id:n}}),this._serializedLayers[o.id]=o.serialize()}0!==o.configDependencies.size&&this._configDependentLayers.add(o.fqid);let s=this._order.length;if(i){const t=this._order.indexOf(i);if(-1===t)return void this.fire(new e.f(new Error(`Layer with id "${i}" does not exist on this map.`)));o.slot===this._layers[i].slot?s=t:e.w(`Layer with id "${i}" has a different slot. Layers can only be rearranged within the same slot.`)}this._order.splice(s,0,n),this._layerOrderChanged=!0,this._layers[n]=o;const a=this.getOwnLayerSourceCache(o),l=!!this.directionalLight&&this.directionalLight.shadowsEnabled();a&&o.canCastShadows()&&l&&(a.castsShadows=!0);const c=this._changes.getRemovedLayer(o);if(c&&o.source&&a&&"custom"!==o.type){this._changes.discardLayerRemoval(o);const t=e.am(o.source,o.scope);c.type!==o.type?this._changes.updateSourceCache(t,"clear"):(this._changes.updateSourceCache(t,"reload"),a.pause())}this._updateLayer(o),o.onAdd&&o.onAdd(this.map),o.scope=this.scope,this.mergeLayers()}moveLayer(t,i){this._checkLoaded();const r=this._checkLayer(t);if(!r)return;if(t===i)return;const n=this._order.indexOf(t);this._order.splice(n,1);let o=this._order.length;if(i){const t=this._order.indexOf(i);if(-1===t)return void this.fire(new e.f(new Error(`Layer with id "${i}" does not exist on this map.`)));r.slot===this._layers[i].slot?o=t:e.w(`Layer with id "${i}" has a different slot. Layers can only be rearranged within the same slot.`)}this._order.splice(o,0,t),this._changes.setDirty(),this._layerOrderChanged=!0,this.mergeLayers()}removeLayer(e){this._checkLoaded();const t=this._checkLayer(e);if(!t)return;t.setEventedParent(null);const i=this._order.indexOf(e);this._order.splice(i,1),delete this._layers[e],delete this._serializedLayers[e],this._changes.setDirty(),this._layerOrderChanged=!0,this._configDependentLayers.delete(t.fqid),this._changes.removeLayer(t);const r=this.getOwnLayerSourceCache(t);if(r&&r.castsShadows){let e=!1;for(const i in this._layers)if(this._layers[i].source===t.source&&this._layers[i].canCastShadows()){e=!0;break}r.castsShadows=e}t.onRemove&&t.onRemove(this.map),this.mergeLayers()}getOwnLayer(e){return this._layers[e]}hasLayer(e){return e in this._mergedLayers}hasLayerType(e){for(const t in this._layers)if(this._layers[t].type===e)return!0;return!1}setLayerZoomRange(e,t,i){this._checkLoaded();const r=this._checkLayer(e);r&&(r.minzoom===t&&r.maxzoom===i||(null!=t&&(r.minzoom=t),null!=i&&(r.maxzoom=i),this._updateLayer(r)))}getSlots(){return this._checkLoaded(),this._mergedSlots}setSlot(e,t){this._checkLoaded();const i=this._checkLayer(e);i&&i.slot!==t&&(i.slot=t,this._updateLayer(i))}setFilter(t,i,r={}){this._checkLoaded();const n=this._checkLayer(t);if(n&&!e.d(n.filter,i))return null==i?(n.filter=void 0,void this._updateLayer(n)):void(this._validate(Ge,`layers.${n.id}.filter`,i,{layerType:n.type},r)||(n.filter=e.cW(i),this._updateLayer(n)))}getFilter(t){const i=this._checkLayer(t);if(i)return e.cW(i.filter)}setLayoutProperty(t,i,r,n={}){this._checkLoaded();const o=this._checkLayer(t);if(o&&!e.d(o.getLayoutProperty(i),r)){if(null!=r&&(!n||!1!==n.validate)&&Mo(o,Ze.call(Be,{key:`layers.${t}.layout.${i}`,layerType:o.type,objectKey:i,value:r,styleSpec:e.N,style:{glyphs:!0,sprite:!0}})))return;o.setLayoutProperty(i,r),0!==o.configDependencies.size&&this._configDependentLayers.add(o.fqid),this._updateLayer(o)}}getLayoutProperty(e,t){const i=this._checkLayer(e);if(i)return i.getLayoutProperty(t)}setPaintProperty(t,i,r,n={}){this._checkLoaded();const o=this._checkLayer(t);if(!o)return;if(e.d(o.getPaintProperty(i),r))return;if(null!=r&&(!n||!1!==n.validate)&&Mo(o,qe.call(Be,{key:`layers.${t}.paint.${i}`,layerType:o.type,objectKey:i,value:r,styleSpec:e.N})))return;const s=o.setPaintProperty(i,r);0!==o.configDependencies.size&&this._configDependentLayers.add(o.fqid),s&&this._updateLayer(o),this._changes.updatePaintProperties(o)}getPaintProperty(e,t){const i=this._checkLayer(e);if(i)return i.getPaintProperty(t)}setFeatureState(t,i){this._checkLoaded();const r=t.source,n=t.sourceLayer,o=this._checkSource(r);if(!o)return;const s=o.type;if("geojson"===s&&n)return void this.fire(new e.f(new Error("GeoJSON sources cannot have a sourceLayer parameter.")));if("vector"===s&&!n)return void this.fire(new e.f(new Error("The sourceLayer parameter must be provided for vector source types.")));void 0===t.id&&this.fire(new e.f(new Error("The feature id parameter must be provided.")));const a=this.getOwnSourceCaches(r);for(const e of a)e.setFeatureState(n,t.id,i)}removeFeatureState(t,i){this._checkLoaded();const r=t.source,n=this._checkSource(r);if(!n)return;const o=n.type,s="vector"===o?t.sourceLayer:void 0;if("vector"===o&&!s)return void this.fire(new e.f(new Error("The sourceLayer parameter must be provided for vector source types.")));if(i&&"string"!=typeof t.id&&"number"!=typeof t.id)return void this.fire(new e.f(new Error("A feature id is required to remove its specific state property.")));const a=this.getOwnSourceCaches(r);for(const e of a)e.removeFeatureState(s,t.id,i)}getFeatureState(t){this._checkLoaded();const i=t.source,r=t.sourceLayer,n=this._checkSource(i);if(n){if("vector"!==n.type||r)return void 0===t.id&&this.fire(new e.f(new Error("The feature id parameter must be provided."))),this.getOwnSourceCaches(i)[0].getFeatureState(r,t.id);this.fire(new e.f(new Error("The sourceLayer parameter must be provided for vector source types.")))}}setTransition(t){return this.stylesheet.transition=e.Q({},this.stylesheet.transition,t),this.transition=this.stylesheet.transition,this}getTransition(){return e.Q({},this.stylesheet.transition)}serialize(){this._checkLoaded();const t=this.getTerrain(),i=t&&this.terrain&&this.terrain.scope===this.scope?t:this.stylesheet.terrain;return e.d0({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,fragment:this.stylesheet.fragment,imports:this._serializeImports(),schema:this.stylesheet.schema,camera:this.stylesheet.camera,light:this.stylesheet.light,lights:this.stylesheet.lights,terrain:i,fog:this.stylesheet.fog,center:this.stylesheet.center,"color-theme":this.stylesheet["color-theme"],zoom:this.stylesheet.zoom,bearing:this.stylesheet.bearing,pitch:this.stylesheet.pitch,sprite:this.stylesheet.sprite,glyphs:this.stylesheet.glyphs,transition:this.stylesheet.transition,projection:this.stylesheet.projection,sources:this._serializeSources(),layers:this._serializeLayers(this._order)},(e=>void 0!==e))}_updateLayer(t){this._changes.updateLayer(t);const i=this.getLayerSourceCache(t),r=e.am(t.source,t.scope),n=this._changes.getUpdatedSourceCaches();t.source&&!n[r]&&i&&"raster"!==i.getSource().type&&(this._changes.updateSourceCache(r,"reload"),i.pause()),t.invalidateCompiledFilter()}_flattenAndSortRenderedFeatures(e){const t=e=>"fill-extrusion"===this._mergedLayers[e].type||"model"===this._mergedLayers[e].type,i=this.order,r={},n=[];for(let o=i.length-1;o>=0;o--){const s=i[o];if(t(s)){r[s]=o;for(const t of e){const e=t[s];if(e)for(const t of e)n.push(t)}}}n.sort(((e,t)=>t.intersectionZ-e.intersectionZ));const o=[];for(let s=i.length-1;s>=0;s--){const a=i[s];if(t(a))for(let e=n.length-1;e>=0;e--){const t=n[e].feature;if(t.layer&&r[t.layer.id]{const t=this.getLayer(e);return t&&t.is3D()})):this.has3DLayers(),l=Cn.createFromScreenPoints(t,r);for(const e in this._mergedSourceCaches){const t=this._mergedSourceCaches[e].getSource();if(!t||t.scope!==i.scope)continue;const c=this._mergedSourceCaches[e].getSource().id;i.layers&&!n[c]||o.push(Ln(this._mergedSourceCaches[e],this._mergedLayers,s,l,i,r,a,!!this.map._showQueryGeometry))}return this.placement&&o.push((function(e,t,i,r,n,o,s){const a={},l=o.queryRenderedSymbols(r),c=[];for(const e of Object.keys(l).map(Number))c.push(s[e]);c.sort(On);for(const i of c){const r=i.featureIndex.lookupSymbolFeatures(l[i.bucketInstanceId],t,i.bucketIndex,i.sourceLayerIndex,n.filter,n.layers,n.availableImages,e);for(const e in r){const t=a[e]=a[e]||[],n=r[e];n.sort(((e,t)=>{const r=i.featureSortOrder;if(r){const i=r.indexOf(e.featureIndex);return r.indexOf(t.featureIndex)-i}return t.featureIndex-e.featureIndex}));for(const e of n)t.push(e)}}for(const t in a)a[t].forEach((r=>{const n=r.feature,o=i(e[t]);if(!o)return;const s=o.getFeatureState(n.layer["source-layer"],n.id);n.source=n.layer.source,n.layer["source-layer"]&&(n.sourceLayer=n.layer["source-layer"]),n.state=s}));return a})(this._mergedLayers,s,this.getLayerSourceCache.bind(this),l.screenGeometry,i,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(o)}querySourceFeatures(e,t){t&&t.filter&&this._validate(Ge,"querySourceFeatures.filter",t.filter,null,t);const i=this.getOwnSourceCaches(e);let r=[];for(const e of i)r=r.concat(kn(e,t));return r}addSourceType(e,t,i){return zo.getSourceType(e)?i(new Error(`A source type called "${e}" already exists.`)):(zo.setSourceType(e,t),t.workerSourceURL?void this.dispatcher.broadcast("loadWorkerSource",{name:e,url:t.workerSourceURL},i):i(null,null))}getFlatLight(){return this.light.getLight()}setFlatLight(t,i,r={}){this._checkLoaded();const n=this.light.getLight();let o=!1;for(const i in t)if(!e.d(t[i],n[i])){o=!0;break}if(!o)return;const s=this._getTransitionParameters();this.light.setLight(t,i,r),this.light.updateTransitions(s)}getTerrain(){return this.terrain&&1===this.terrain.drapeRenderMode?this.terrain.get():null}setTerrainForDraping(){this.setTerrain({source:"",exaggeration:0},0)}checkCanvasFingerprintNoise(){void 0===this.disableElevatedTerrain&&(this.disableElevatedTerrain=e.e.hasCanvasFingerprintNoise(),this.disableElevatedTerrain&&e.w("Terrain and hillshade are disabled because of Canvas2D limitations when fingerprinting protection is enabled (e.g. in private browsing mode)."))}setTerrain(t,i=1){if(this._checkLoaded(),!t)return this.terrainSetForDrapingOnly()||(delete this.terrain,this.map.transform.projection.requiresDraping&&this.setTerrainForDraping()),0===i&&delete this.terrain,null===t?this.stylesheet.terrain=null:delete this.stylesheet.terrain,this._force3DLayerUpdate(),void(this._markersNeedUpdate=!0);this.checkCanvasFingerprintNoise();let r=t;const n=null==t.source;if(1===i){if(this.disableElevatedTerrain)return;if("object"==typeof r.source){const t="terrain-dem-src";this.addSource(t,r.source),r=e.cW(r),r=e.Q(r,{source:t})}const t=e.Q({},r),i={};if(this.terrain&&n){t.source=this.terrain.get().source;const e=this.terrain?this.getFragmentStyle(this.terrain.scope):null;e&&(i.style=e.serialize())}if(this._validate(Ue,"terrain",t,i))return}if(!this.terrain||this.terrain.scope!==this.scope&&!n||this.terrain&&i!==this.terrain.drapeRenderMode){if(!r)return;this._createTerrain(r,i),this.fire(new e.g("data",{dataType:"style"}))}else{const i=this.terrain,n=i.get();for(const t of Object.keys(e.N.terrain))!r.hasOwnProperty(t)&&e.N.terrain[t].default&&(r[t]=e.N.terrain[t].default);for(const r in t)if(!e.d(t[r],n[r])){i.set(t,this.options),this.stylesheet.terrain=t;const r=this._getTransitionParameters({duration:0});i.updateTransitions(r),this.fire(new e.g("data",{dataType:"style"}));break}}this.mergeTerrain(),this.updateDrapeFirstLayers(),this._markersNeedUpdate=!0}_createFog(e){const t=this.fog=new lt(e,this.map.transform,this.scope,this.options);this.stylesheet.fog=t.get();const i=this._getTransitionParameters({duration:0});t.updateTransitions(i)}_updateMarkersOpacity(){0!==this.map._markers.length&&this.map._requestDomTask((()=>{for(const e of this.map._markers)e._evaluateOpacity()}))}getFog(){return this.fog?this.fog.get():null}setFog(t){if(this._checkLoaded(),!t)return delete this.fog,delete this.stylesheet.fog,void(this._markersNeedUpdate=!0);if(this.fog){const i=this.fog;if(!e.d(i.get(),t)){i.set(t,this.options),this.stylesheet.fog=i.get();const e=this._getTransitionParameters({duration:0});i.updateTransitions(e)}}else this._createFog(t);this._markersNeedUpdate=!0}setColorTheme(t){this._checkLoaded();const i=()=>{for(const e in this._layers)this._layers[e].lut=this._styleColorTheme.lut;for(const e in this._sourceCaches)this._sourceCaches[e].clearTiles()};if(this._styleColorTheme.colorTheme=t,!t)return this._styleColorTheme.lut=null,void i();const r=this._evaluateColorThemeData(t);this._loadColorTheme(r).then((()=>{this.fire(new e.g("colorthemeset")),i()})).catch((t=>{e.w(`Couldn't set color theme: ${t}`)}))}_getTransitionParameters(t){return{now:e.e.now(),transition:e.Q(this.transition,t)}}updateDrapeFirstLayers(){if(!this.terrain)return;const e=[],t=[];for(const i of this._mergedOrder)this.isLayerDraped(this._mergedLayers[i])?e.push(i):t.push(i);this._drapedFirstOrder=[],this._drapedFirstOrder.push(...e),this._drapedFirstOrder.push(...t)}_createTerrain(e,t){const i=this.terrain=new Qe(e,t,this.scope,this.options);1===t&&(this.stylesheet.terrain=e),this.mergeTerrain(),this.updateDrapeFirstLayers(),this._force3DLayerUpdate();const r=this._getTransitionParameters({duration:0});i.updateTransitions(r)}_force3DLayerUpdate(){for(const e in this._layers){const t=this._layers[e];"fill-extrusion"===t.type&&this._updateLayer(t)}}_forceSymbolLayerUpdate(){for(const e in this._layers){const t=this._layers[e];"symbol"===t.type&&this._updateLayer(t)}}_validate(t,i,r,n,o={}){if(o&&!1===o.validate)return!1;const s=e.Q({},this.serialize());return Mo(this,t.call(Be,e.Q({key:i,style:s,value:r,styleSpec:e.N},n)))}_remove(){this._request&&(this._request.cancel(),this._request=null),this._spriteRequest&&(this._spriteRequest.cancel(),this._spriteRequest=null),e.d1.off("pluginStateChange",this._rtlTextPluginCallback);for(const e in this._mergedLayers)this._mergedLayers[e].setEventedParent(null);for(const e in this._mergedSourceCaches)this._mergedSourceCaches[e].clearTiles(),this._mergedSourceCaches[e].setEventedParent(null);this.setEventedParent(null),delete this.fog,delete this.terrain,delete this.ambientLight,delete this.directionalLight,this.isRootStyle()&&(this.imageManager.setEventedParent(null),this.modelManager.setEventedParent(null),this.dispatcher.remove())}clearSource(e){const t=this.getSourceCaches(e);for(const e of t)e.clearTiles()}clearSources(){for(const e in this._mergedSourceCaches)this._mergedSourceCaches[e].clearTiles()}reloadSource(e){const t=this.getSourceCaches(e);for(const e of t)e.resume(),e.reload()}reloadSources(){for(const e of this.getSources())e.reload&&e.reload()}updateSources(e){let t;this.directionalLight&&(t=bi(this.directionalLight));for(const i in this._mergedSourceCaches)this._mergedSourceCaches[i].update(e,void 0,void 0,t)}_generateCollisionBoxes(){for(const e in this._sourceCaches){const t=this._sourceCaches[e];t.resume(),t.reload()}}_updatePlacement(t,i,r,n,o,s,a=!1){let l=!1,c=!1;const h={},u={};for(const t of this._mergedOrder){const r=this._mergedLayers[t];if("symbol"!==r.type)continue;const n=e.am(r.source,r.scope);let o=h[n];if(!o){const e=this.getLayerSourceCache(r);if(!e)continue;const t=e.getRenderableIds(!0).map((t=>e.getTileByID(t)));u[n]=t.slice(),o=h[n]=t.sort(((e,t)=>t.tileID.overscaledZ-e.tileID.overscaledZ||(e.tileID.isLessThan(t.tileID)?-1:1)))}const s=this.crossTileSymbolIndex.addLayer(r,o,i.center.lng,i.projection);l=l||s}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._mergedOrder),a=a||this._layerOrderChanged||0===n,this._layerOrderChanged&&this.fire(new e.g("neworder")),(a||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(e.e.now(),i.zoom))&&(this.pauseablePlacement=new xo(i,this._mergedOrder,a,r,n,o,this.placement,this.fog&&i.projection.supportsFog?this.fog.state:null,this._buildingIndex),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._mergedOrder,this._mergedLayers,h,u),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(e.e.now()),c=!0),l&&this.pauseablePlacement.placement.setStale()),c||l){this._buildingIndex.onNewFrame(i.zoom);for(let t=0;tte===t.id)))return void this.fire(new e.f(new Error(`Import with id '${t.id}' already exists in the map's style.`)));if(!i)return r.push(t),this._loadImports([t],!0);const n=r.findIndex((({id:e})=>e===i));return-1===n&&this.fire(new e.f(new Error(`Import with id "${i}" does not exist on this map.`))),this.stylesheet.imports=r.slice(0,n).concat(t).concat(r.slice(n)),this._loadImports([t],!0,i)}updateImport(t,i){this._checkLoaded();const r=this.stylesheet.imports||[],n=this.getImportIndex(t);return-1===n?this:"string"==typeof i?(this.setImportUrl(t,i),this):(i.url&&i.url!==r[n].url&&this.setImportUrl(t,i.url),e.d(i.config,r[n].config)||this.setImportConfig(t,i.config),e.d(i.data,r[n].data)||this.setImportData(t,i.data),this)}moveImport(e,t){this._checkLoaded();let i=this.stylesheet.imports||[];const r=this.getImportIndex(e);if(-1===r)return this;const n=this.getImportIndex(t);if(-1===n)return this;const o=i[r],s=this.fragments[r];return i=i.filter((({id:t})=>t!==e)),this.fragments=this.fragments.filter((({id:t})=>t!==e)),this.stylesheet.imports=i.slice(0,n).concat(o).concat(i.slice(n)),this.fragments=this.fragments.slice(0,n).concat(s).concat(this.fragments.slice(n)),this.mergeLayers(),this}setImportUrl(e,t){this._checkLoaded();const i=this.stylesheet.imports||[],r=this.getImportIndex(e);if(-1===r)return this;i[r].url=t;const n=this.fragments[r];return n.style=this._createFragmentStyle(i[r]),n.style.on("style.import.load",(()=>this.mergeAll())),n.style.loadURL(t),this}setImportData(e,t){this._checkLoaded();const i=this.getImportIndex(e),r=this.stylesheet.imports||[];return-1===i?this:t?(this.fragments[i].style.setState(t),this._reloadImports(),this):(delete r[i].data,this.setImportUrl(e,r[i].url))}setImportConfig(e,t){this._checkLoaded();const i=this.getImportIndex(e),r=this.stylesheet.imports||[];if(-1===i)return this;t?r[i].config=t:delete r[i].config;const n=this.fragments[i],o=n.style.stylesheet&&n.style.stylesheet.schema;return n.config=t,n.style.updateConfig(t,o),this.updateConfigDependencies(),this}removeImport(e){this._checkLoaded();const t=this.stylesheet.imports||[],i=this.getImportIndex(e);-1!==i&&(t.splice(i,1),this.fragments[i].style._remove(),this.fragments.splice(i,1),this._reloadImports())}getImportIndex(t){const i=(this.stylesheet.imports||[]).findIndex((e=>e.id===t));return-1===i&&this.fire(new e.f(new Error(`Import '${t}' does not exist in the map's style and cannot be updated.`))),i}getLayer(e){return this._mergedLayers[e]}getSources(){const e=[];for(const t in this._mergedOtherSourceCaches){const i=this._mergedOtherSourceCaches[t];i&&e.push(i.getSource())}return e}getSource(e,t){const i=this.getSourceCache(e,t);return i&&i.getSource()}getLayerSource(e){const t=this.getLayerSourceCache(e);return t&&t.getSource()}getSourceCache(t,i){const r=e.am(t,i);return this._mergedOtherSourceCaches[r]}getLayerSourceCache(t){const i=e.am(t.source,t.scope);return"symbol"===t.type?this._mergedSymbolSourceCaches[i]:this._mergedOtherSourceCaches[i]}getSourceCaches(e){if(null==e)return Object.values(this._mergedSourceCaches);const t=[];return this._mergedOtherSourceCaches[e]&&t.push(this._mergedOtherSourceCaches[e]),this._mergedSymbolSourceCaches[e]&&t.push(this._mergedSymbolSourceCaches[e]),t}updateSourceCaches(){const e=this._changes.getUpdatedSourceCaches();for(const t in e){const i=e[t];"reload"===i?this.reloadSource(t):"clear"===i&&this.clearSource(t)}}updateLayers(e){const t=this._changes.getUpdatedPaintProperties();for(const i of t){const t=this.getLayer(i);t&&t.updateTransitions(e)}}getImages(e,t,i){this.imageManager.getImages(t.icons,t.scope,i),this._updateTilesForChangedImages();const r=e=>{e&&e.setDependencies(t.tileID.key,t.type,t.icons)};r(this._otherSourceCaches[t.source]),r(this._symbolSourceCaches[t.source])}getGlyphs(e,t,i){this.glyphManager.getGlyphs(t.stacks,t.scope,i)}getResource(t,i,r){return e.d2(i,r)}getOwnSourceCache(e){return this._otherSourceCaches[e]}getOwnLayerSourceCache(e){return"symbol"===e.type?this._symbolSourceCaches[e.source]:this._otherSourceCaches[e.source]}getOwnSourceCaches(e){const t=[];return this._otherSourceCaches[e]&&t.push(this._otherSourceCaches[e]),this._symbolSourceCaches[e]&&t.push(this._symbolSourceCaches[e]),t}_isSourceCacheLoaded(t){const i=this.getOwnSourceCaches(t);return 0===i.length?(this.fire(new e.f(new Error(`There is no source with ID '${t}'`))),!1):i.every((e=>e.loaded()))}has3DLayers(){return this._has3DLayers}hasSymbolLayers(){return this._hasSymbolLayers}hasCircleLayers(){return this._hasCircleLayers}isLayerClipped(t,i){if(0===this._clipLayerIndices.length&&"fill-extrusion"!==t.type)return!1;const r="fill-extrusion"===t.type&&"building"===t.sourceLayer;let n=0;if(t.is3D()){if(r||i&&"batched-model"===i.type)return!0;"model"===t.type&&(n=e.cw.Model)}else"symbol"===t.type&&(n=e.cw.Symbol);for(const t of this._clipLayerIndices){const i=this._mergedLayers[this._mergedOrder[t]];if(!i)continue;const r=[];for(const t of i.layout.get("clip-layer-types"))r.push("model"===t?e.cw.Model:"symbol"===t?e.cw.Symbol:e.cw.FillExtrusion);for(const e of r)if(n&e)return!0}return!1}_clearWorkerCaches(){this.dispatcher.broadcast("clearCaches")}destroy(){this._clearWorkerCaches(),this.fragments.forEach((e=>{e.style._remove()})),this.terrainSetForDrapingOnly()&&(delete this.terrain,delete this.stylesheet.terrain)}}function Do(e,t){let i=!1,r=null;const n=()=>{r=null,i&&(e(),r=setTimeout(n,t),i=!1)};return()=>(i=!0,r||n(),r)}zo.getSourceType=function(e){return Di[e]},zo.setSourceType=function(e,t){Di[e]=t},zo.registerForPluginStateChange=e.cO;class Ro{constructor(t){this._hashName=t&&encodeURIComponent(t),e.br(["_getCurrentHash","_onHashChange","_updateHash"],this),this._updateHash=Do(this._updateHashUnthrottled.bind(this),300)}addTo(e){return this._map=e,window.addEventListener("hashchange",this._onHashChange,!1),e.on("moveend",this._updateHash),this}remove(){return this._map?(this._map.off("moveend",this._updateHash),window.removeEventListener("hashchange",this._onHashChange,!1),clearTimeout(this._updateHash()),this._map=void 0,this):this}getHashString(){const e=this._map;if(!e)return"";const t=Lo(e);if(this._hashName){const e=this._hashName;let i=!1;const r=location.hash.slice(1).split("&").map((r=>{const n=r.split("=")[0];return n===e?(i=!0,`${n}=${t}`):r})).filter((e=>e));return i||r.push(`${e}=${t}`),`#${r.join("&")}`}return`#${t}`}_getCurrentHash(){const e=location.hash.replace("#","");if(this._hashName){let t;return e.split("&").map((e=>e.split("="))).forEach((e=>{e[0]===this._hashName&&(t=e)})),(t&&t[1]||"").split("/")}return e.split("/")}_onHashChange(){const e=this._map;if(!e)return!1;const t=this._getCurrentHash();if(t.length>=3&&!t.some((e=>isNaN(e)))){const i=e.dragRotate.isEnabled()&&e.touchZoomRotate.isEnabled()?+(t[3]||0):e.getBearing();return e.jumpTo({center:[+t[2],+t[1]],zoom:+t[0],bearing:i,pitch:+(t[4]||0)}),!0}return!1}_updateHashUnthrottled(){history.replaceState(history.state,"",location.href.replace(/(#.+)?$/,this.getHashString()))}}function Lo(e,t){const i=e.getCenter(),r=Math.round(100*e.getZoom())/100,n=Math.ceil((r*Math.LN2+Math.log(2.8444444444444446))/Math.LN10),o=Math.pow(10,n),s=Math.round(i.lng*o)/o,a=Math.round(i.lat*o)/o,l=e.getBearing(),c=e.getPitch();let h=t?`/${s}/${a}/${r}`:`${r}/${a}/${s}`;return(l||c)&&(h+="/"+Math.round(10*l)/10),c&&(h+=`/${Math.round(c)}`),h}const ko={linearity:.3,easing:e.d3(0,0,.3,1)},Oo=e.Q({deceleration:2500,maxSpeed:1400},ko),Bo=e.Q({deceleration:20,maxSpeed:1400},ko),Fo=e.Q({deceleration:1e3,maxSpeed:360},ko),No=e.Q({deceleration:1e3,maxSpeed:90},ko);class Vo{constructor(e){this._map=e,this.clear()}clear(){this._inertiaBuffer=[]}record(t){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:e.e.now(),settings:t})}_drainInertiaBuffer(){const t=this._inertiaBuffer,i=e.e.now();for(;t.length>0&&i-t[0].time>160;)t.shift()}_onMoveEnd(t){if(this._map._prefersReducedMotion())return;if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;const i={zoom:0,bearing:0,pitch:0,pan:new e.P(0,0),pinchAround:void 0,around:void 0};for(const{settings:e}of this._inertiaBuffer)i.zoom+=e.zoomDelta||0,i.bearing+=e.bearingDelta||0,i.pitch+=e.pitchDelta||0,e.panDelta&&i.pan._add(e.panDelta),e.around&&(i.around=e.around),e.pinchAround&&(i.pinchAround=e.pinchAround);const r=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,n={};if(i.pan.mag()){const o=jo(i.pan.mag(),r,e.Q({},Oo,t||{}));n.offset=i.pan.mult(o.amount/i.pan.mag()),n.center=this._map.transform.center,Uo(n,o)}if(i.zoom){const e=jo(i.zoom,r,Bo);n.zoom=this._map.transform.zoom+e.amount,Uo(n,e)}if(i.bearing){const t=jo(i.bearing,r,Fo);n.bearing=this._map.transform.bearing+e.au(t.amount,-179,179),Uo(n,t)}if(i.pitch){const e=jo(i.pitch,r,No);n.pitch=this._map.transform.pitch+e.amount,Uo(n,e)}if(n.zoom||n.bearing){const e=void 0===i.pinchAround?i.around:i.pinchAround;n.around=e?this._map.unproject(e):this._map.getCenter()}return this.clear(),n.noMoveStart=!0,n}}function Uo(e,t){(!e.duration||e.durationi.unproject(e))),a=o.reduce(((e,t,i,r)=>e.add(t.div(r.length))),new e.P(0,0));super(t,{points:o,point:a,lngLats:s,lngLat:i.unproject(a),originalEvent:r}),this._defaultPrevented=!1}}class qo extends e.g{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(e,t){super("wheel",{originalEvent:t}),this._defaultPrevented=!1}}class Zo{constructor(e,t){this._map=e,this._clickTolerance=t.clickTolerance}reset(){this._mousedownPos=void 0}wheel(e){return this._firePreventable(new qo(this._map,e))}mousedown(e,t){return this._mousedownPos=t,this._firePreventable(new $o(e.type,this._map,e))}mouseup(e){this._map.fire(new $o(e.type,this._map,e))}preclick(t){const i=e.Q({},t);i.type="preclick",this._map.fire(new $o(i.type,this._map,i))}click(e,t){this._mousedownPos&&this._mousedownPos.dist(t)>=this._clickTolerance||(this.preclick(e),this._map.fire(new $o(e.type,this._map,e)))}dblclick(e){return this._firePreventable(new $o(e.type,this._map,e))}mouseover(e){this._map.fire(new $o(e.type,this._map,e))}mouseout(e){this._map.fire(new $o(e.type,this._map,e))}touchstart(e){return this._firePreventable(new Go(e.type,this._map,e))}touchmove(e){this._map.fire(new Go(e.type,this._map,e))}touchend(e){this._map.fire(new Go(e.type,this._map,e))}touchcancel(e){this._map.fire(new Go(e.type,this._map,e))}_firePreventable(e){if(this._map.fire(e),e.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Wo{constructor(e){this._map=e}reset(){this._delayContextMenu=!1,this._contextMenuEvent=void 0}mousemove(e){this._map.fire(new $o(e.type,this._map,e))}mousedown(){this._delayContextMenu=!0}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new $o("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(e){this._delayContextMenu?this._contextMenuEvent=e:this._map.fire(new $o(e.type,this._map,e)),this._map.listens("contextmenu")&&e.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Ho{constructor(e,t){this._map=e,this._el=e.getCanvasContainer(),this._container=e.getContainer(),this._clickTolerance=t.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(e,t){this.isEnabled()&&e.shiftKey&&0===e.button&&(d(),this._startPos=this._lastPos=t,this._active=!0)}mousemoveWindow(e,t){if(!this._active)return;const i=t,r=this._startPos,o=this._lastPos;if(!r||!o||o.equals(i)||!this._box&&i.dist(r){this._box&&(this._box.style.transform=`translate(${s}px,${l}px)`,this._box.style.width=a-s+"px",this._box.style.height=c-l+"px")}))}mouseupWindow(t,i){if(!this._active)return;const r=this._startPos,n=i;if(r&&0===t.button){if(this.reset(),m(),r.x!==n.x||r.y!==n.y)return this._map.fire(new e.g("boxzoomend",{originalEvent:t})),{cameraAnimation:e=>e.fitScreenCoordinates(r,n,this._map.getBearing(),{linear:!1})};this._fireEvent("boxzoomcancel",t)}}keydown(e){this._active&&27===e.keyCode&&(this.reset(),this._fireEvent("boxzoomcancel",e))}blur(){this.reset()}reset(){this._active=!1,this._container.classList.remove("mapboxgl-crosshair"),this._box&&(this._box.remove(),this._box=null),p(),delete this._startPos,delete this._lastPos}_fireEvent(t,i){return this._map.fire(new e.g(t,{originalEvent:i}))}}function Xo(e,t){const i={};for(let r=0;rthis.numTouches)&&(this.aborted=!0),this.aborted||(0===this.startTime&&(this.startTime=t.timeStamp),r.length===this.numTouches&&(this.centroid=(function(t){const i=new e.P(0,0);for(const e of t)i._add(e);return i.div(t.length)})(i),this.touches=Xo(r,i)))}touchmove(e,t,i){if(this.aborted||!this.centroid)return;const r=Xo(i,t);for(const e in this.touches){const t=r[e];(!t||t.dist(this.touches[e])>30)&&(this.aborted=!0)}}touchend(e,t,i){if((!this.centroid||e.timeStamp-this.startTime>500)&&(this.aborted=!0),0===i.length){const e=!this.aborted&&this.centroid;if(this.reset(),e)return e}}}class Jo{constructor(e){this.singleTap=new Yo(e),this.numTaps=e.numTaps,this.reset()}reset(){this.lastTime=1/0,this.lastTap=void 0,this.count=0,this.singleTap.reset()}touchstart(e,t,i){this.singleTap.touchstart(e,t,i)}touchmove(e,t,i){this.singleTap.touchmove(e,t,i)}touchend(e,t,i){const r=this.singleTap.touchend(e,t,i);if(r){const t=e.timeStamp-this.lastTime<500,i=!this.lastTap||this.lastTap.dist(r)<30;if(t&&i||this.reset(),this.count++,this.lastTime=e.timeStamp,this.lastTap=r,this.count===this.numTaps)return this.reset(),r}}}class Ko{constructor(){this._zoomIn=new Jo({numTouches:1,numTaps:2}),this._zoomOut=new Jo({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(e,t,i){this._zoomIn.touchstart(e,t,i),this._zoomOut.touchstart(e,t,i)}touchmove(e,t,i){this._zoomIn.touchmove(e,t,i),this._zoomOut.touchmove(e,t,i)}touchend(e,t,i){const r=this._zoomIn.touchend(e,t,i),n=this._zoomOut.touchend(e,t,i);return r?(this._active=!0,e.preventDefault(),setTimeout((()=>this.reset()),0),{cameraAnimation:t=>t.easeTo({duration:300,zoom:t.getZoom()+1,around:t.unproject(r)},{originalEvent:e})}):n?(this._active=!0,e.preventDefault(),setTimeout((()=>this.reset()),0),{cameraAnimation:t=>t.easeTo({duration:300,zoom:t.getZoom()-1,around:t.unproject(n)},{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}}const Qo={0:1,2:2};class es{constructor(e){this.reset(),this._clickTolerance=e.clickTolerance||1}blur(){this.reset()}reset(){this._active=!1,this._moved=!1,this._lastPoint=void 0,this._eventButton=void 0}_correctButton(e,t){return!1}_move(e,t){return{}}mousedown(e,t){if(this._lastPoint)return;const i=y(e);this._correctButton(e,i)&&(this._lastPoint=t,this._eventButton=i)}mousemoveWindow(e,t){const i=this._lastPoint;if(i)if(e.preventDefault(),null!=this._eventButton&&(function(e,t){const i=Qo[t];return void 0===e.buttons||(e.buttons&i)!==i})(e,this._eventButton))this.reset();else if(this._moved||!(t.dist(i)0&&(this._active=!0);const n=Xo(r,i),o=new e.P(0,0),s=new e.P(0,0);let a=0;for(const e in n){const t=n[e],i=this._touches[e];i&&(o._add(t),s._add(t.sub(i)),a++,n[e]=t)}if(this._touches=n,a{this._alertContainer.classList.remove("mapboxgl-touch-pan-blocker-show"),this._alertContainer.removeAttribute("role")}),500)}}class os{constructor(){this.reset()}reset(){this._active=!1,this._firstTwoTouches=void 0}_start(e){}_move(e,t,i){return{}}touchstart(e,t,i){this._firstTwoTouches||i.length<2||(this._firstTwoTouches=[i[0].identifier,i[1].identifier],this._start([t[0],t[1]]))}touchmove(e,t,i){const r=this._firstTwoTouches;if(!r)return;e.preventDefault();const[n,o]=r,s=ss(i,t,n),a=ss(i,t,o);if(!s||!a)return;const l=this._aroundCenter?null:s.add(a).div(2);return this._move([s,a],l,e)}touchend(e,t,i){if(!this._firstTwoTouches)return;const[r,n]=this._firstTwoTouches,o=ss(i,t,r),s=ss(i,t,n);o&&s||(this._active&&m(),this.reset())}touchcancel(){this.reset()}enable(e){this._enabled=!0,this._aroundCenter=!!e&&"center"===e.around}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}function ss(e,t,i){for(let r=0;rMath.abs(e.x)}class ds extends os{constructor(e){super(),this._map=e}reset(){super.reset(),this._valid=void 0,this._firstMove=void 0,this._lastPoints=void 0}_start(e){this._lastPoints=e,us(e[0].sub(e[1]))&&(this._valid=!1)}_move(t,i,r){const n=this._lastPoints;if(!n)return;const o=t[0].sub(n[0]),s=t[1].sub(n[1]);return this._map._cooperativeGestures&&!e.d4()&&r.touches.length<3||(this._valid=this.gestureBeginsVertically(o,s,r.timeStamp),!this._valid)?void 0:(this._lastPoints=t,this._active=!0,{pitchDelta:(o.y+s.y)/2*-.5})}gestureBeginsVertically(e,t,i){if(void 0!==this._valid)return this._valid;const r=e.mag()>=2,n=t.mag()>=2;if(!r&&!n)return;if(!r||!n)return null==this._firstMove&&(this._firstMove=i),i-this._firstMove<100&&void 0;const o=e.y>0==t.y>0;return us(e)&&us(t)&&o}}const ps={panStep:100,bearingStep:15,pitchStep:10};class fs{constructor(){const e=ps;this._panStep=e.panStep,this._bearingStep=e.bearingStep,this._pitchStep=e.pitchStep,this._rotationDisabled=!1}blur(){this.reset()}reset(){this._active=!1}keydown(e){if(e.altKey||e.ctrlKey||e.metaKey)return;let t=0,i=0,r=0,n=0,o=0;switch(e.keyCode){case 61:case 107:case 171:case 187:t=1;break;case 189:case 109:case 173:t=-1;break;case 37:e.shiftKey?i=-1:(e.preventDefault(),n=-1);break;case 39:e.shiftKey?i=1:(e.preventDefault(),n=1);break;case 38:e.shiftKey?r=1:(e.preventDefault(),o=-1);break;case 40:e.shiftKey?r=-1:(e.preventDefault(),o=1);break;default:return}return this._rotationDisabled&&(i=0,r=0),{cameraAnimation:s=>{const a=s.getZoom();s.easeTo({duration:300,easeId:"keyboardHandler",easing:ms,zoom:t?Math.round(a)+t*(e.shiftKey?2:1):a,bearing:s.getBearing()+i*this._bearingStep,pitch:s.getPitch()+r*this._pitchStep,offset:[-n*this._panStep,-o*this._panStep],center:s.getCenter()},{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 ms(e){return e*(2-e)}const _s=4.000244140625;class gs{constructor(t,i){this._map=t,this._el=t.getCanvasContainer(),this._handler=i,this._delta=0,this._lastDelta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222,e.br(["_onTimeout","_addScrollZoomBlocker","_showBlockerAlert"],this)}setZoomRate(e){this._defaultZoomRate=e}setWheelZoomRate(e){this._wheelZoomRate=e}isEnabled(){return!!this._enabled}isActive(){return this._active||void 0!==this._finishTimeout}isZooming(){return!!this._zooming}enable(e){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!e&&"center"===e.around,this._map._cooperativeGestures&&this._addScrollZoomBlocker())}disable(){this.isEnabled()&&(this._enabled=!1,this._map._cooperativeGestures&&(clearTimeout(this._alertTimer),this._alertContainer.remove()))}wheel(t){if(!this.isEnabled())return;if(this._map._cooperativeGestures){if(!(t.ctrlKey||t.metaKey||this.isZooming()||e.d4()))return void this._showBlockerAlert();"hidden"!==this._alertContainer.style.visibility&&(this._alertContainer.style.visibility="hidden",clearTimeout(this._alertTimer))}let i=t.deltaMode===WheelEvent.DOM_DELTA_LINE?40*t.deltaY:t.deltaY;const r=e.e.now(),n=r-(this._lastWheelEventTime||0);this._lastWheelEventTime=r,0!==i&&i%_s==0?this._type="wheel":0!==i&&Math.abs(i)<4?this._type="trackpad":n>400?(this._type=null,this._lastValue=i,this._timeout=window.setTimeout(this._onTimeout,40,t)):this._type||(this._type=Math.abs(n*i)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,i+=this._lastValue)),t.shiftKey&&i&&(i/=4),this._type&&(this._lastWheelEvent=t,this._delta-=i,this._active||this._start(t)),t.preventDefault()}_onTimeout(e){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(e)}_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 t=_(this._el,e);this._aroundPoint=this._aroundCenter?this._map.transform.centerPoint:t,this._aroundCoord=this._map.transform.pointCoordinate3D(this._aroundPoint),this._targetZoom=void 0,this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame())}renderFrame(){if(!this._frameId)return;if(this._frameId=null,!this.isActive())return;const t=this._map.transform;"wheel"===this._type&&t.projection.wrap&&(t._center.lng>=180||t._center.lng<=-180)&&(this._prevEase=null,this._easing=null,this._lastWheelEvent=null,this._lastWheelEventTime=0);const i=()=>t._terrainEnabled()&&this._aroundCoord?t.computeZoomRelativeTo(this._aroundCoord):t.zoom;if(0!==this._delta){const e="wheel"===this._type&&Math.abs(this._delta)>_s?this._wheelZoomRate:this._defaultZoomRate;let r=2/(1+Math.exp(-Math.abs(this._delta*e)));this._delta<0&&0!==r&&(r=1/r);const n=i(),o=Math.pow(2,n),s="number"==typeof this._targetZoom?t.zoomScale(this._targetZoom):o;this._targetZoom=Math.min(t.maxZoom,Math.max(t.minZoom,t.scaleZoom(s*r))),"wheel"===this._type&&(this._startZoom=n,this._easing=this._smoothOutEasing(200)),this._lastDelta=this._delta,this._delta=0}const r="number"==typeof this._targetZoom?this._targetZoom:i(),n=this._startZoom,o=this._easing;let s,a=!1;if("wheel"===this._type&&n&&o){const t=Math.min((e.e.now()-this._lastWheelEventTime)/200,1),i=o(t);s=e.a3(n,r,i),t<1?this._frameId||(this._frameId=!0):a=!0}else s=r,a=!0;this._active=!0,a&&(this._active=!1,this._finishTimeout=window.setTimeout((()=>{this._zooming=!1,this._handler._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout}),200));let l=s-i();return l*this._lastDelta<0&&(l=0),{noInertia:!0,needsRenderFrame:!a,zoomDelta:l,around:this._aroundPoint,aroundCoord:this._aroundCoord,originalEvent:this._lastWheelEvent}}_smoothOutEasing(t){let i=e.d5;if(this._prevEase){const t=this._prevEase,r=(e.e.now()-t.start)/t.duration,n=t.easing(r+.01)-t.easing(r),o=.27/Math.sqrt(n*n+1e-4)*.01,s=Math.sqrt(.0729-o*o);i=e.d3(o,s,.25,1)}return this._prevEase={start:e.e.now(),duration:t,easing:i},i}blur(){this.reset()}reset(){this._active=!1}_addScrollZoomBlocker(){this._map&&!this._alertContainer&&(this._alertContainer=n("div","mapboxgl-scroll-zoom-blocker",this._map._container),this._alertContainer.textContent=/(Mac|iPad)/i.test(navigator.userAgent)?this._map._getUIString("ScrollZoomBlocker.CmdMessage"):this._map._getUIString("ScrollZoomBlocker.CtrlMessage"),this._alertContainer.style.fontSize=`${Math.max(10,Math.min(24,Math.floor(.05*this._el.clientWidth)))}px`)}_showBlockerAlert(){this._alertContainer.style.visibility="visible",this._alertContainer.classList.add("mapboxgl-scroll-zoom-blocker-show"),this._alertContainer.setAttribute("role","alert"),clearTimeout(this._alertTimer),this._alertTimer=window.setTimeout((()=>{this._alertContainer.classList.remove("mapboxgl-scroll-zoom-blocker-show"),this._alertContainer.removeAttribute("role")}),200)}}class ys{constructor(e,t){this._clickZoom=e,this._tapZoom=t}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 xs{constructor(){this.reset()}reset(){this._active=!1}blur(){this.reset()}dblclick(e,t){return e.preventDefault(),{cameraAnimation:i=>{i.easeTo({duration:300,zoom:i.getZoom()+(e.shiftKey?-1:1),around:i.unproject(t)},{originalEvent:e})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class vs{constructor(){this._tap=new Jo({numTouches:1,numTaps:1}),this.reset()}reset(){this._active=!1,this._swipePoint=void 0,this._swipeTouch=0,this._tapTime=0,this._tap.reset()}touchstart(e,t,i){this._swipePoint||(this._tapTime&&e.timeStamp-this._tapTime>500&&this.reset(),this._tapTime?i.length>0&&(this._swipePoint=t[0],this._swipeTouch=i[0].identifier):this._tap.touchstart(e,t,i))}touchmove(e,t,i){if(this._tapTime){if(this._swipePoint){if(i[0].identifier!==this._swipeTouch)return;const r=t[0],n=r.y-this._swipePoint.y;return this._swipePoint=r,e.preventDefault(),this._active=!0,{zoomDelta:n/128}}}else this._tap.touchmove(e,t,i)}touchend(e,t,i){this._tapTime?this._swipePoint&&0===i.length&&this.reset():this._tap.touchend(e,t,i)&&(this._tapTime=e.timeStamp)}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class bs{constructor(e,t,i){this._el=e,this._mousePan=t,this._touchPan=i}enable(e){this._inertiaOptions=e||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("mapboxgl-touch-drag-pan")}disable(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("mapboxgl-touch-drag-pan")}isEnabled(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()}isActive(){return this._mousePan.isActive()||this._touchPan.isActive()}}class ws{constructor(e,t,i){this._pitchWithRotate=e.pitchWithRotate,this._mouseRotate=t,this._mousePitch=i}enable(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()}disable(){this._mouseRotate.disable(),this._mousePitch.disable()}isEnabled(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())}isActive(){return this._mouseRotate.isActive()||this._mousePitch.isActive()}}class Ts{constructor(e,t,i,r){this._el=e,this._touchZoom=t,this._touchRotate=i,this._tapDragZoom=r,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("mapboxgl-touch-zoom-rotate")}disable(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("mapboxgl-touch-zoom-rotate")}isEnabled(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()}isActive(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()}disableRotation(){this._rotationDisabled=!0,this._touchRotate.disable()}enableRotation(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()}}const Es=e=>e.zoom||e.drag||e.pitch||e.rotate;class Ss extends e.g{}class Ms{constructor(){this.constants=[1,1,.01],this.radius=0}setup(t,i){const r=e.$.sub([],i,t);this.radius=e.$.length(r[2]<0?e.$.div([],r,this.constants):[r[0],r[1],0])}projectRay(t){e.$.div(t,t,this.constants),e.$.normalize(t,t),e.$.mul(t,t,this.constants);const i=e.$.scale([],t,this.radius);if(i[2]>0){const t=e.$.scale([],[0,0,1],e.$.dot(i,[0,0,1])),r=e.$.scale([],e.$.normalize([],[i[0],i[1],0]),this.radius),n=e.$.add([],i,e.$.scale([],e.$.sub([],e.$.add([],r,t),i),2));i[0]=n[0],i[1]=n[1]}return i}}function As(e){return e.panDelta&&e.panDelta.mag()||e.zoomDelta||e.bearingDelta||e.pitchDelta}class Is{constructor(t,i){this._map=t,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new Vo(t),this._bearingSnap=i.bearingSnap,this._previousActiveHandlers={},this._trackingEllipsoid=new Ms,this._dragOrigin=null,this._eventsInProgress={},this._addDefaultHandlers(i),e.br(["handleEvent","handleWindowEvent"],this);const r=this._el;this._listeners=[[r,"touchstart",{passive:!0}],[r,"touchmove",{passive:!1}],[r,"touchend",void 0],[r,"touchcancel",void 0],[r,"mousedown",void 0],[r,"mousemove",void 0],[r,"mouseup",void 0],[document,"mousemove",{capture:!0}],[document,"mouseup",void 0],[r,"mouseover",void 0],[r,"mouseout",void 0],[r,"dblclick",void 0],[r,"click",void 0],[r,"keydown",{capture:!1}],[r,"keyup",void 0],[r,"wheel",{passive:!1}],[r,"contextmenu",void 0],[window,"blur",void 0]];for(const[e,t,i]of this._listeners){const r=e===document?this.handleWindowEvent:this.handleEvent;e.addEventListener(t,r,i)}}destroy(){for(const[e,t,i]of this._listeners){const r=e===document?this.handleWindowEvent:this.handleEvent;e.removeEventListener(t,r,i)}}_addDefaultHandlers(e){const t=this._map,i=t.getCanvasContainer();this._add("mapEvent",new Zo(t,e));const r=t.boxZoom=new Ho(t,e);this._add("boxZoom",r);const n=new Ko,o=new xs;t.doubleClickZoom=new ys(o,n),this._add("tapZoom",n),this._add("clickZoom",o);const s=new vs;this._add("tapDragZoom",s);const a=t.touchPitch=new ds(t);this._add("touchPitch",a);const l=new is(e),c=new rs(e);t.dragRotate=new ws(e,l,c),this._add("mouseRotate",l,["mousePitch"]),this._add("mousePitch",c,["mouseRotate"]);const h=new ts(e),u=new ns(t,e);t.dragPan=new bs(i,h,u),this._add("mousePan",h),this._add("touchPan",u,["touchZoom","touchRotate"]);const d=new hs,p=new ls;t.touchZoomRotate=new Ts(i,p,d,s),this._add("touchRotate",d,["touchPan","touchZoom"]),this._add("touchZoom",p,["touchPan","touchRotate"]),this._add("blockableMapEvent",new Wo(t));const f=t.scrollZoom=new gs(t,this);this._add("scrollZoom",f,["mousePan"]);const m=t.keyboard=new fs;this._add("keyboard",m);for(const i of["boxZoom","doubleClickZoom","tapDragZoom","touchPitch","dragRotate","dragPan","touchZoomRotate","scrollZoom","keyboard"])e.interactive&&e[i]&&t[i].enable(e[i])}_add(e,t,i){this._handlers.push({handlerName:e,handler:t,allowed:i}),this._handlersById[e]=t}stop(e){if(!this._updatingCamera){for(const{handler:e}of this._handlers)e.reset();this._inertia.clear(),this._fireEvents({},{},e),this._changes=[],this._originalZoom=void 0}}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!!Es(this._eventsInProgress)||this.isZooming()}_isDragging(){return!!this._eventsInProgress.drag}_blockedByActive(e,t,i){for(const r in e)if(r!==i&&(!t||t.indexOf(r)<0))return!0;return!1}handleWindowEvent(e){this.handleEvent(e,`${e.type}Window`)}_getMapTouches(e){const t=[];for(const i of e)this._el.contains(i.target)&&t.push(i);return t}handleEvent(e,t){this._updatingCamera=!0;const i="renderFrame"===e.type,r=i?void 0:e,n={needsRenderFrame:!1},o={},s={},a=e.touches?this._getMapTouches(e.touches):void 0,l=a?g(this._el,a):i?void 0:_(this._el,e);for(const{handlerName:i,handler:c,allowed:h}of this._handlers){if(!c.isEnabled())continue;let u;this._blockedByActive(s,h,i)?c.reset():c[t||e.type]&&(u=c[t||e.type](e,l,a),this.mergeHandlerResult(n,o,u,i,r),u&&u.needsRenderFrame&&this._triggerRenderFrame()),(u||c.isActive())&&(s[i]=c)}const c={};for(const e in this._previousActiveHandlers)s[e]||(c[e]=r);this._previousActiveHandlers=s,(Object.keys(c).length||As(n))&&(this._changes.push([n,o,c]),this._triggerRenderFrame()),(Object.keys(s).length||As(n))&&this._map._stop(!0),this._updatingCamera=!1;const{cameraAnimation:h}=n;h&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],h(this._map))}mergeHandlerResult(t,i,r,n,o){if(!r)return;e.Q(t,r);const s={handlerName:n,originalEvent:r.originalEvent||o};void 0!==r.zoomDelta&&(i.zoom=s),void 0!==r.panDelta&&(i.drag=s),void 0!==r.pitchDelta&&(i.pitch=s),void 0!==r.bearingDelta&&(i.rotate=s)}_applyChanges(){const t={},i={},r={};for(const[n,o,s]of this._changes)n.panDelta&&(t.panDelta=(t.panDelta||new e.P(0,0))._add(n.panDelta)),n.zoomDelta&&(t.zoomDelta=(t.zoomDelta||0)+n.zoomDelta),n.bearingDelta&&(t.bearingDelta=(t.bearingDelta||0)+n.bearingDelta),n.pitchDelta&&(t.pitchDelta=(t.pitchDelta||0)+n.pitchDelta),void 0!==n.around&&(t.around=n.around),void 0!==n.aroundCoord&&(t.aroundCoord=n.aroundCoord),void 0!==n.pinchAround&&(t.pinchAround=n.pinchAround),n.noInertia&&(t.noInertia=n.noInertia),e.Q(i,o),e.Q(r,s);this._updateMapTransform(t,i,r),this._changes=[]}_updateMapTransform(t,i,r){const n=this._map,o=n.transform,s=e=>[e.x,e.y,e.z];if((()=>{const e=this._eventsInProgress.drag;return e&&!this._handlersById[e.handlerName].isActive()})()&&!As(t)){const e=o.zoom;o.cameraElevationReference="sea",null!=this._originalZoom&&o._orthographicProjectionAtLowPitch&&"globe"!==o.projection.name&&0===o.pitch?(o.cameraElevationReference="ground",o.zoom=this._originalZoom):(o.recenterOnTerrain(),o.cameraElevationReference="ground"),e!==o.zoom&&this._map._update(!0)}if(o._isCameraConstrained&&n._stop(!0),!As(t))return void this._fireEvents(i,r,!0);let{panDelta:a,zoomDelta:l,bearingDelta:c,pitchDelta:h,around:u,aroundCoord:d,pinchAround:p}=t;o._isCameraConstrained&&(l>0&&(l=0),o._isCameraConstrained=!1),void 0!==p&&(u=p),(l||(e=>i[e]&&!this._eventsInProgress[e])("drag"))&&u&&(this._dragOrigin=s(o.pointCoordinate3D(u)),this._originalZoom=o.zoom,this._trackingEllipsoid.setup(o._camera.position,this._dragOrigin)),o.cameraElevationReference="sea",n._stop(!0),u=u||n.transform.centerPoint,c&&(o.bearing+=c),h&&(o.pitch+=h),o._updateCameraState();const f=[0,0,0];if(a)if("mercator"===o.projection.name){const e=this._trackingEllipsoid.projectRay(o.screenPointToMercatorRay(u).dir),t=this._trackingEllipsoid.projectRay(o.screenPointToMercatorRay(u.sub(a)).dir);f[0]=t[0]-e[0],f[1]=t[1]-e[1]}else{const t=o.pointCoordinate(u);if("globe"===o.projection.name){a=a.rotate(-o.angle);const i=o._pixelsPerMercatorPixel/o.worldSize;f[0]=-a.x*e.d6(e.az(t.y))*i,f[1]=-a.y*e.d6(o.center.lat)*i}else{const e=o.pointCoordinate(u.sub(a));t&&e&&(f[0]=e.x-t.x,f[1]=e.y-t.y)}}const m=o.zoom,_=[0,0,0];if(l){const t=s(d||o.pointCoordinate3D(u)),i={dir:e.$.normalize([],e.$.sub([],t,o._camera.position))};if(i.dir[2]<0){const r=o.zoomDeltaToMovement(t,l);e.$.scale(_,i.dir,r)}}const g=e.$.add(f,f,_);o._translateCameraConstrained(g),l&&Math.abs(o.zoom-m)>1e-4&&o.recenterOnTerrain(),o.cameraElevationReference="ground",this._map._update(),t.noInertia||this._inertia.record(t),this._fireEvents(i,r,!0)}_fireEvents(t,i,r){const n=Es(this._eventsInProgress),o=Es(t),s={};for(const e in t){const{originalEvent:i}=t[e];this._eventsInProgress[e]||(s[`${e}start`]=i),this._eventsInProgress[e]=t[e]}!n&&o&&this._fireEvent("movestart",o.originalEvent);for(const e in s)this._fireEvent(e,s[e]);o&&this._fireEvent("move",o.originalEvent);for(const e in t){const{originalEvent:i}=t[e];this._fireEvent(e,i)}const a={};let l;for(const e in this._eventsInProgress){const{handlerName:t,originalEvent:r}=this._eventsInProgress[e];this._handlersById[t].isActive()||(delete this._eventsInProgress[e],l=i[t]||r,a[`${e}end`]=l)}for(const e in a)this._fireEvent(e,a[e]);const c=Es(this._eventsInProgress);if(r&&(n||o)&&!c){this._updatingCamera=!0;const t=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),i=e=>0!==e&&-this._bearingSnap{this._frameId=void 0,this.handleEvent(new Ss("renderFrame",{timeStamp:e})),this._applyChanges()}))}_triggerRenderFrame(){void 0===this._frameId&&(this._frameId=this._requestFrame())}}const Cs="map.setFreeCameraOptions(...) and map.getFreeCameraOptions() are not yet supported for non-mercator projections.";class Ps extends e.E{constructor(t,i){super(),this._moving=!1,this._zooming=!1,this.transform=t,this._bearingSnap=i.bearingSnap,this._respectPrefersReducedMotion=!1!==i.respectPrefersReducedMotion,e.br(["_renderFrameCallback"],this)}getCenter(){return new e.aJ(this.transform.center.lng,this.transform.center.lat)}setCenter(e,t){return this.jumpTo({center:e},t)}panBy(t,i,r){return t=e.P.convert(t).mult(-1),this.panTo(this.transform.center,e.Q({offset:t},i),r)}panTo(t,i,r){return this.easeTo(e.Q({center:t},i),r)}getZoom(){return this.transform.zoom}setZoom(e,t){return this.jumpTo({zoom:e},t),this}zoomTo(t,i,r){return this.easeTo(e.Q({zoom:t},i),r)}zoomIn(e,t){return this.zoomTo(this.getZoom()+1,e,t),this}zoomOut(e,t){return this.zoomTo(this.getZoom()-1,e,t),this}getBearing(){return this.transform.bearing}setBearing(e,t){return this.jumpTo({bearing:e},t),this}getPadding(){return this.transform.padding}setPadding(e,t){return this.jumpTo({padding:e},t),this}rotateTo(t,i,r){return this.easeTo(e.Q({bearing:t},i),r)}resetNorth(t,i){return this.rotateTo(0,e.Q({duration:1e3},t),i),this}resetNorthPitch(t,i){return this.easeTo(e.Q({bearing:0,pitch:0,duration:1e3},t),i),this}snapToNorth(e,t){return Math.abs(this.getBearing())e.aspect?i/(2*Math.tan(.5*e.fovX)*e.aspect):r/(2*Math.tan(.5*e.fovY)*e.aspect)}_cameraForBoundsOnGlobe(t,i,r,n,o,s){const a=t.clone(),l=this._extendCameraOptions(s);a.bearing=n,a.pitch=o;const c=e.aJ.convert(i),h=e.aJ.convert(r),u=.5*(c.lat+h.lat),d=.5*(c.lng+h.lng),p=e.d7(u,d),f=e.$.normalize([],p),m=e.$.normalize([],e.$.cross([],f,[0,1,0])),_=e.$.cross([],m,f),g=[m[0],m[1],m[2],0,_[0],_[1],_[2],0,f[0],f[1],f[2],0,0,0,0,1],y=[p,e.d7(c.lat,c.lng),e.d7(h.lat,c.lng),e.d7(h.lat,h.lng),e.d7(c.lat,h.lng),e.d7(u,c.lng),e.d7(u,h.lng),e.d7(c.lat,d),e.d7(h.lat,d)];let x=e.b8.fromPoints(y.map((t=>[e.$.dot(m,t),e.$.dot(_,t),e.$.dot(f,t)])));const v=e.$.transformMat4([],x.center,g);0===e.$.squaredLength(v)&&e.$.set(v,0,0,1),e.$.normalize(v,v),e.$.scale(v,v,e.cF),a.center=e.d8(v);const b=a.getWorldToCameraMatrix(),w=e.ae.invert(new Float64Array(16),b);x=e.b8.applyTransform(x,e.ae.multiply([],b,g));const T=this._extendAABB(x,a,l,n);if(!T)return void e.w("Map cannot fit within canvas with the given bounds, padding, and/or offset.");x=T,e.$.transformMat4(v,v,b);const E=.5*(x.max[2]-x.min[2]),S=this._minimumAABBFrustumDistance(a,x),M=e.$.scale([],[0,0,1],E),A=e.$.add(M,v,M),I=S+(0===a.pitch?0:e.$.distance(v,A)),C=a.globeCenterInViewSpace,P=e.$.sub([],v,[C[0],C[1],C[2]]);e.$.normalize(P,P),e.$.scale(P,P,I);const z=e.$.add([],v,P);e.$.transformMat4(z,z,w);const D=e.da/e.cF,R=e.$.length(z),L=e.ay(Math.max(R*D-e.da,Number.EPSILON),0),k=Math.min(a.zoomFromMercatorZAdjusted(L),l.maxZoom);return k>.5*(e.b3+e.aV)?(a.setProjection({name:"mercator"}),a.zoom=k,this._cameraForBounds(a,i,r,n,o,s)):{center:a.center,zoom:k,bearing:n,pitch:o}}_extendAABB(t,i,r,n){const o=.5*((r.padding.left||0)+(r.padding.right||0)),s=.5*((r.padding.top||0)+(r.padding.bottom||0)),a=s,l=o,c=o,h=s,u=i.width-(l+c),d=i.height-(a+h),p=e.$.sub([],t.max,t.min),f=Math.min(u/p[0],d/p[1]),m=Math.min(i.scaleZoom(i.scale*f),r.maxZoom);if(isNaN(m))return null;const _=i.scale/i.zoomScale(m),g=new e.b8([t.min[0]-l*_,t.min[1]-h*_,t.min[2]],[t.max[0]+c*_,t.max[1]+a*_,t.max[2]]),y=("number"==typeof r.offset.x&&"number"==typeof r.offset.y?new e.P(r.offset.x,r.offset.y):e.P.convert(r.offset)).rotate(-e.ac(n));return g.center[0]-=y.x*_,g.center[1]+=y.y*_,g}queryTerrainElevation(t,i){const r=this.transform.elevation;return r?(i=e.Q({},{exaggerated:!0},i),r.getAtPoint(e._.fromLngLat(t),null,i.exaggerated)):null}_cameraForBounds(t,i,r,n,o,s){if("globe"===t.projection.name)return this._cameraForBoundsOnGlobe(t,i,r,n,o,s);const a=t.clone(),l=this._extendCameraOptions(s);a.bearing=n,a.pitch=o;const c=e.aJ.convert(i),h=e.aJ.convert(r),u=new e.aJ(c.lng,h.lat),d=new e.aJ(h.lng,c.lat),p=a.project(c),f=a.project(h),m=this.queryTerrainElevation(c),_=this.queryTerrainElevation(h),g=this.queryTerrainElevation(u),y=this.queryTerrainElevation(d),x=[[p.x,p.y,Math.min(m||0,_||0,g||0,y||0)],[f.x,f.y,Math.max(m||0,_||0,g||0,y||0)]];let v=e.b8.fromPoints(x);const b=a.getWorldToCameraMatrix(),w=e.ae.invert(new Float64Array(16),b);v=e.b8.applyTransform(v,b);const T=this._extendAABB(v,a,l,n);if(!T)return void e.w("Map cannot fit within canvas with the given bounds, padding, and/or offset.");v=T;const E=.5*e.$.sub([],v.max,v.min)[2],S=this._minimumAABBFrustumDistance(a,v),M=[0,0,1,0];e.aB.transformMat4(M,M,b),e.aB.normalize(M,M);const A=e.$.scale([],M,S+E),I=e.$.add([],v.center,A);e.$.transformMat4(v.center,v.center,w),e.$.transformMat4(I,I,w);const C=[v.center[0],v.center[1],I[2]*a.pixelsPerMeter];e.$.scale(C,C,1/a.worldSize);const P=e.d9(C[0]),z=e.az(C[1]),D=Math.min(a._zoomFromMercatorZ(C[2]),l.maxZoom),R=new e.aJ(P,z);return a.mercatorFromTransition&&D<.5*(e.b3+e.aV)?(a.setProjection({name:"globe"}),a.zoom=D,this._cameraForBounds(a,i,r,n,o,s)):{center:R,zoom:D,bearing:n,pitch:o}}fitBounds(e,t,i){const r=this.cameraForBounds(e,t);return this._fitInternal(r,t,i)}fitScreenCoordinates(t,i,r,n,o){const s=e.P.convert(t),a=e.P.convert(i),l=new e.P(Math.min(s.x,a.x),Math.min(s.y,a.y)),c=new e.P(Math.max(s.x,a.x),Math.max(s.y,a.y));if("mercator"===this.transform.projection.name&&this.transform.anyCornerOffEdge(s,a))return this;const h=this.transform.pointLocation3D(l),u=this.transform.pointLocation3D(c),d=this.transform.pointLocation3D(new e.P(l.x,c.y)),p=this.transform.pointLocation3D(new e.P(c.x,l.y)),f=[Math.min(h.lng,u.lng,d.lng,p.lng),Math.min(h.lat,u.lat,d.lat,p.lat)],m=[Math.max(h.lng,u.lng,d.lng,p.lng),Math.max(h.lat,u.lat,d.lat,p.lat)],_=n&&n.pitch?n.pitch:this.getPitch(),g=this._cameraForBounds(this.transform,f,m,r,_,n);return this._fitInternal(g,n,o)}_fitInternal(t,i,r){return t?(i=e.Q(t,i)).linear?this.easeTo(i,r):this.flyTo(i,r):this}jumpTo(t,i){this.stop();const r=t.preloadOnly?this.transform.clone():this.transform;let n=!1,o=!1,s=!1;if("zoom"in t&&r.zoom!==+t.zoom&&(n=!0,r.zoom=+t.zoom),void 0!==t.center&&(r.center=e.aJ.convert(t.center)),"bearing"in t&&r.bearing!==+t.bearing&&(o=!0,r.bearing=+t.bearing),"pitch"in t&&r.pitch!==+t.pitch&&(s=!0,r.pitch=+t.pitch),null!=t.padding){const e="number"==typeof t.padding?this._extendPadding(t.padding):t.padding;r.isPaddingEqual(e)||(r.padding=e)}return t.preloadOnly?(this._preloadTiles(r),this):(this.fire(new e.g("movestart",i)).fire(new e.g("move",i)),n&&this.fire(new e.g("zoomstart",i)).fire(new e.g("zoom",i)).fire(new e.g("zoomend",i)),o&&this.fire(new e.g("rotatestart",i)).fire(new e.g("rotate",i)).fire(new e.g("rotateend",i)),s&&this.fire(new e.g("pitchstart",i)).fire(new e.g("pitch",i)).fire(new e.g("pitchend",i)),this.fire(new e.g("moveend",i)))}getFreeCameraOptions(){return this.transform.projection.supportsFreeCamera||e.w(Cs),this.transform.getFreeCameraOptions()}setFreeCameraOptions(t,i){const r=this.transform;if(!r.projection.supportsFreeCamera)return e.w(Cs),this;this.stop();const n=r.zoom,o=r.pitch,s=r.bearing;r.setFreeCameraOptions(t);const a=n!==r.zoom,l=o!==r.pitch,c=s!==r.bearing;return this.fire(new e.g("movestart",i)).fire(new e.g("move",i)),a&&this.fire(new e.g("zoomstart",i)).fire(new e.g("zoom",i)).fire(new e.g("zoomend",i)),c&&this.fire(new e.g("rotatestart",i)).fire(new e.g("rotate",i)).fire(new e.g("rotateend",i)),l&&this.fire(new e.g("pitchstart",i)).fire(new e.g("pitch",i)).fire(new e.g("pitchend",i)),this.fire(new e.g("moveend",i)),this}easeTo(t,i){this._stop(!1,t.easeId),(!1===(t=e.Q({offset:[0,0],duration:500,easing:e.d5},t)).animate||this._prefersReducedMotion(t))&&(t.duration=0);const r=this.transform,n=this.getZoom(),o=this.getBearing(),s=this.getPitch(),a=this.getPadding(),l="zoom"in t?+t.zoom:n,c="bearing"in t?this._normalizeBearing(t.bearing,o):o,h="pitch"in t?+t.pitch:s,u=this._extendPadding(t.padding),d=e.P.convert(t.offset);let p,f,m;if("globe"===r.projection.name){const i=e._.fromLngLat(r.center),n=d.rotate(-r.angle);i.x+=n.x/r.worldSize,i.y+=n.y/r.worldSize;const o=i.toLngLat(),s=e.aJ.convert(t.center||o);this._normalizeCenter(s),p=r.centerPoint.add(n),f=new e.P(i.x,i.y).mult(r.worldSize),m=new e.P(e.ak(s.lng),e.al(s.lat)).mult(r.worldSize).sub(f)}else{p=r.centerPoint.add(d);const i=r.pointLocation(p),n=e.aJ.convert(t.center||i);this._normalizeCenter(n),f=r.project(i),m=r.project(n).sub(f)}const _=r.zoomScale(l-n);let g,y;t.around&&(g=e.aJ.convert(t.around),y=r.locationPoint(g));const x=this._zooming||l!==n,v=this._rotating||o!==c,b=this._pitching||h!==s,w=!r.isPaddingEqual(u),T=r=>T=>{if(x&&(r.zoom=e.a3(n,l,T)),v&&(r.bearing=e.a3(o,c,T)),b&&(r.pitch=e.a3(s,h,T)),w&&(r.interpolatePadding(a,u,T),p=r.centerPoint.add(d)),g)r.setLocationAtPoint(g,y);else{const e=r.zoomScale(r.zoom-n),t=l>n?Math.min(2,_):Math.max(.5,_),i=Math.pow(t,1-T),o=r.unproject(f.add(m.mult(T*i)).mult(e));r.setLocationAtPoint(r.renderWorldCopies?o.wrap():o,p)}return t.preloadOnly||this._fireMoveEvents(i),r};if(t.preloadOnly){const e=this._emulate(T,t.duration,r);return this._preloadTiles(e),this}const E={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching};return this._zooming=x,this._rotating=v,this._pitching=b,this._padding=w,this._easeId=t.easeId,this._prepareEase(i,t.noMoveStart,E),this._ease(T(r),(e=>{"sea"===r.cameraElevationReference&&r.recenterOnTerrain(),this._afterEase(i,e)}),t),this}_prepareEase(t,i,r={}){this._moving=!0,this.transform.cameraElevationReference="sea",this.transform._orthographicProjectionAtLowPitch&&0===this.transform.pitch&&"globe"!==this.transform.projection.name&&(this.transform.cameraElevationReference="ground"),i||r.moving||this.fire(new e.g("movestart",t)),this._zooming&&!r.zooming&&this.fire(new e.g("zoomstart",t)),this._rotating&&!r.rotating&&this.fire(new e.g("rotatestart",t)),this._pitching&&!r.pitching&&this.fire(new e.g("pitchstart",t))}_fireMoveEvents(t){this.fire(new e.g("move",t)),this._zooming&&this.fire(new e.g("zoom",t)),this._rotating&&this.fire(new e.g("rotate",t)),this._pitching&&this.fire(new e.g("pitch",t))}_afterEase(t,i){if(this._easeId&&i&&this._easeId===i)return;this._easeId=void 0,this.transform.cameraElevationReference="ground";const r=this._zooming,n=this._rotating,o=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,r&&this.fire(new e.g("zoomend",t)),n&&this.fire(new e.g("rotateend",t)),o&&this.fire(new e.g("pitchend",t)),this.fire(new e.g("moveend",t))}flyTo(t,i){if(this._prefersReducedMotion(t)){const r=e.ai(t,["center","zoom","bearing","pitch","around","padding"]);return this.jumpTo(r,i)}this.stop(),t=e.Q({offset:[0,0],speed:1.2,curve:1.42,easing:e.d5},t);const r=this.transform,n=this.getZoom(),o=this.getBearing(),s=this.getPitch(),a=this.getPadding(),l="zoom"in t?e.au(+t.zoom,r.minZoom,r.maxZoom):n,c="bearing"in t?this._normalizeBearing(t.bearing,o):o,h="pitch"in t?+t.pitch:s,u=this._extendPadding(t.padding),d=r.zoomScale(l-n),p=e.P.convert(t.offset);let f=r.centerPoint.add(p);const m=r.pointLocation(f),_=e.aJ.convert(t.center||m);this._normalizeCenter(_);const g=r.project(m),y=r.project(_).sub(g);let x=t.curve;const v=Math.max(r.width,r.height),b=v/d,w=y.mag();if("minZoom"in t){const i=e.au(Math.min(t.minZoom,n,l),r.minZoom,r.maxZoom),o=v/r.zoomScale(i-n);x=Math.sqrt(o/w*2)}const T=x*x;function E(e){const t=(b*b-v*v+(e?-1:1)*T*T*w*w)/(2*(e?b:v)*T*w);return Math.log(Math.sqrt(t*t+1)-t)}function S(e){return(Math.exp(e)-Math.exp(-e))/2}function M(e){return(Math.exp(e)+Math.exp(-e))/2}const A=E(0);let I=function(e){return M(A)/M(A+x*e)},C=function(e){return v*((M(A)*(S(t=A+x*e)/M(t))-S(A))/T)/w;var t},P=(E(1)-A)/x;if(Math.abs(w)<1e-6||!isFinite(P)){if(Math.abs(v-b)<1e-6)return this.easeTo(t,i);const e=bt.maxDuration&&(t.duration=0);const z=o!==c,D=h!==s,R=!r.isPaddingEqual(u),L=r=>d=>{const m=d*P,x=1/I(m);r.zoom=1===d?l:n+r.scaleZoom(x),z&&(r.bearing=e.a3(o,c,d)),D&&(r.pitch=e.a3(s,h,d)),R&&(r.interpolatePadding(a,u,d),f=r.centerPoint.add(p));const v=1===d?_:r.unproject(g.add(y.mult(C(m))).mult(x));return r.setLocationAtPoint(r.renderWorldCopies?v.wrap():v,f),r._updateCameraOnTerrain(),t.preloadOnly||this._fireMoveEvents(i),r};if(t.preloadOnly){const e=this._emulate(L,t.duration,r);return this._preloadTiles(e),this}return this._zooming=!0,this._rotating=z,this._pitching=D,this._padding=R,this._prepareEase(i,!1),this._ease(L(r),(()=>this._afterEase(i)),t),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_requestRenderFrame(e){}_cancelRenderFrame(e){}_stop(e,t){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),this._easeFrameId=void 0,this._onEaseFrame=void 0),this._onEaseEnd){const e=this._onEaseEnd;this._onEaseEnd=void 0,e.call(this,t)}if(!e){const e=this.handlers;e&&e.stop(!1)}return this}_ease(t,i,r){!1===r.animate||0===r.duration?(t(1),i()):(this._easeStart=e.e.now(),this._easeOptions=r,this._onEaseFrame=t,this._onEaseEnd=i,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_renderFrameCallback(){const t=Math.min((e.e.now()-this._easeStart)/this._easeOptions.duration,1),i=this._onEaseFrame;i&&i(this._easeOptions.easing(t)),t<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()}_normalizeBearing(t,i){t=e.av(t,-180,180);const r=Math.abs(t-i);return Math.abs(t-360-i)180?-360:i<-180?360:0}_prefersReducedMotion(t){return this._respectPrefersReducedMotion&&e.e.prefersReducedMotion&&!(t&&t.essential)}_emulate(e,t,i){const r=Math.ceil(15*t/1e3),n=[],o=e(i.clone());for(let e=0;e<=r;e++){const t=o(e/r);n.push(t.clone())}return n}_preloadTiles(e,t){}}class zs{constructor(t={}){this.options=t,e.br(["_toggleAttribution","_updateEditLink","_updateData","_updateCompact"],this)}getDefaultPosition(){return"bottom-right"}onAdd(e){const t=this.options&&this.options.compact,i=e._getUIString("AttributionControl.ToggleAttribution");this._map=e,this._container=n("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._compactButton=n("button","mapboxgl-ctrl-attrib-button",this._container),this._compactButton.type="button",this._compactButton.addEventListener("click",this._toggleAttribution),this._compactButton.setAttribute("aria-label",i);const r=n("span","mapboxgl-ctrl-icon",this._compactButton);return r.setAttribute("aria-hidden","true"),r.setAttribute("title",i),this._innerContainer=n("div","mapboxgl-ctrl-attrib-inner",this._container),t&&this._container.classList.add("mapboxgl-compact"),this._updateAttributions(),this._updateEditLink(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("moveend",this._updateEditLink),void 0===t&&(this._map.on("resize",this._updateCompact),this._updateCompact()),this._container}onRemove(){this._container.remove(),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("moveend",this._updateEditLink),this._map.off("resize",this._updateCompact),this._map=void 0,this._attribHTML=void 0}_toggleAttribution(){this._container.classList.contains("mapboxgl-compact-show")?(this._container.classList.remove("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-expanded","false")):(this._container.classList.add("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-expanded","true"))}_updateEditLink(){let t=this._editLink;t||(t=this._editLink=this._container.querySelector(".mapbox-improve-map"));const i=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:this._map._requestManager._customAccessToken||e.db.ACCESS_TOKEN}];if(t){const r=i.reduce(((e,t,r)=>(t.value&&(e+=`${t.key}=${t.value}${re.length-t.length)),e=e.filter(((t,i)=>{for(let r=i+1;r=0)return!1;return!0})),this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?e=[...this.options.customAttribution,...e]:e.unshift(this.options.customAttribution));const i=e.join(" | ");i!==this._attribHTML&&(this._attribHTML=i,e.length?(this._innerContainer.innerHTML=i,this._container.classList.remove("mapboxgl-attrib-empty")):this._container.classList.add("mapboxgl-attrib-empty"),this._editLink=null)}_updateCompact(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact","mapboxgl-compact-show")}}class Ds{constructor(){e.br(["_updateLogo","_updateCompact"],this)}onAdd(e){this._map=e,this._container=n("div","mapboxgl-ctrl");const t=n("a","mapboxgl-ctrl-logo");return t.target="_blank",t.rel="noopener nofollow",t.href="https://www.mapbox.com/",t.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),t.setAttribute("rel","noopener nofollow"),this._container.appendChild(t),this._container.style.display="none",this._map.on("sourcedata",this._updateLogo),this._updateLogo(),this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){this._container.remove(),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact)}getDefaultPosition(){return"bottom-left"}_updateLogo(e){e&&"metadata"!==e.sourceDataType||(this._container.style.display=this._logoRequired()?"block":"none")}_logoRequired(){if(!this._map.style)return!0;const e=this._map.style._sourceCaches;if(0===Object.entries(e).length)return!0;for(const t in e){const i=e[t].getSource();if(i.hasOwnProperty("mapbox_logo")&&!i.mapbox_logo)return!1}return!0}_updateCompact(){const e=this._container.children;if(e.length){const t=e[0];this._map.getCanvasContainer().offsetWidth<250?t.classList.add("mapboxgl-compact"):t.classList.remove("mapboxgl-compact")}}}class Rs{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(e){const t=++this._id;return this._queue.push({callback:e,id:t,cancelled:!1}),t}remove(e){const t=this._currentlyRunning,i=t?this._queue.concat(t):this._queue;for(const t of i)if(t.id===e)return void(t.cancelled=!0)}run(e=0){const t=this._currentlyRunning=this._queue;this._queue=[];for(const i of t)if(!i.cancelled&&(i.callback(e),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}function Ls(t,i,r){if(t=new e.aJ(t.lng,t.lat),i){const n=new e.aJ(t.lng-360,t.lat),o=new e.aJ(t.lng+360,t.lat),s=360*Math.ceil(Math.abs(t.lng-r.center.lng)/360),a=r.locationPoint(t).distSqr(i),l=i.x<0||i.y<0||i.x>r.width||i.y>r.height;r.locationPoint(n).distSqr(i)180;){const e=r.locationPoint(t);if(e.x>=0&&e.y>=0&&e.x<=r.width&&e.y<=r.height)break;t.lng>r.center.lng?t.lng-=360:t.lng+=360}return t}const ks={center:"translate(-50%,-50%)",top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"};class Os extends e.E{constructor(t,i){if(super(),(t instanceof HTMLElement||i)&&(t=e.Q({element:t},i)),e.br(["_update","_onMove","_onUp","_addDragHandler","_onMapClick","_onKeyPress","_clearFadeTimer"],this),this._anchor=t&&t.anchor||"center",this._color=t&&t.color||"#3FB1CE",this._scale=t&&t.scale||1,this._draggable=t&&t.draggable||!1,this._clickTolerance=t&&t.clickTolerance||0,this._isDragging=!1,this._state="inactive",this._rotation=t&&t.rotation||0,this._rotationAlignment=t&&t.rotationAlignment||"auto",this._pitchAlignment=t&&t.pitchAlignment&&t.pitchAlignment||"auto",this._updateMoving=()=>this._update(!0),this._occludedOpacity=t&&t.occludedOpacity||.2,t&&t.element)this._element=t.element,this._offset=e.P.convert(t&&t.offset||[0,0]);else{this._defaultMarker=!0,this._element=n("div");const i=41,r=27,s=o("svg",{display:"block",height:i*this._scale+"px",width:r*this._scale+"px",viewBox:`0 0 ${r} ${i}`},this._element),a=o("radialGradient",{id:"shadowGradient"},o("defs",{},s));o("stop",{offset:"10%","stop-opacity":.4},a),o("stop",{offset:"100%","stop-opacity":.05},a),o("ellipse",{cx:13.5,cy:34.8,rx:10.5,ry:5.25,fill:"url(#shadowGradient)"},s),o("path",{fill:this._color,d:"M27,13.5C27,19.07 20.25,27 14.75,34.5C14.02,35.5 12.98,35.5 12.25,34.5C6.75,27 0,19.22 0,13.5C0,6.04 6.04,0 13.5,0C20.96,0 27,6.04 27,13.5Z"},s),o("path",{opacity:.25,d:"M13.5,0C6.04,0 0,6.04 0,13.5C0,19.22 6.75,27 12.25,34.5C13,35.52 14.02,35.5 14.75,34.5C20.25,27 27,19.07 27,13.5C27,6.04 20.96,0 13.5,0ZM13.5,1C20.42,1 26,6.58 26,13.5C26,15.9 24.5,19.18 22.22,22.74C19.95,26.3 16.71,30.14 13.94,33.91C13.74,34.18 13.61,34.32 13.5,34.44C13.39,34.32 13.26,34.18 13.06,33.91C10.28,30.13 7.41,26.31 5.02,22.77C2.62,19.23 1,15.95 1,13.5C1,6.58 6.58,1 13.5,1Z"},s),o("circle",{fill:"white",cx:13.5,cy:13.5,r:5.5},s),this._offset=e.P.convert(t&&t.offset||[0,-14])}this._element.hasAttribute("aria-label")||this._element.setAttribute("aria-label","Map marker"),this._element.hasAttribute("role")||this._element.setAttribute("role","img"),this._element.classList.add("mapboxgl-marker"),this._element.addEventListener("dragstart",(e=>{e.preventDefault()})),this._element.addEventListener("mousedown",(e=>{e.preventDefault()}));const r=this._element.classList;for(const e in ks)r.remove(`mapboxgl-marker-anchor-${e}`);r.add(`mapboxgl-marker-anchor-${this._anchor}`);const s=t&&t.className?t.className.trim().split(/\s+/):[];r.add(...s),this._popup=null}addTo(e){return e===this._map||(this.remove(),this._map=e,e.getCanvasContainer().appendChild(this._element),e.on("move",this._updateMoving),e.on("moveend",this._update),e.on("remove",this._clearFadeTimer),e._addMarker(this),this.setDraggable(this._draggable),this._update(),e.on("click",this._onMapClick)),this}remove(){const e=this._map;return e&&(e.off("click",this._onMapClick),e.off("move",this._updateMoving),e.off("moveend",this._update),e.off("mousedown",this._addDragHandler),e.off("touchstart",this._addDragHandler),e.off("mouseup",this._onUp),e.off("touchend",this._onUp),e.off("mousemove",this._onMove),e.off("touchmove",this._onMove),e.off("remove",this._clearFadeTimer),e._removeMarker(this),this._map=void 0),this._clearFadeTimer(),this._element.remove(),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(t){return this._lngLat=e.aJ.convert(t),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(!0),this}getElement(){return this._element}setPopup(e){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeAttribute("role"),this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),e){if(!("offset"in e.options)){const t=13.5,i=Math.sqrt(Math.pow(t,2)/2);e.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[i,-34.14594154601839],"bottom-right":[-9.545941546018392,-34.14594154601839],left:[t,-24.6],right:[-13.5,-24.6]}:this._offset}this._popup=e,e._marker=this,this._lngLat&&this._popup.setLngLat(this._lngLat),this._element.setAttribute("role","button"),this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress),this._element.setAttribute("aria-expanded","false")}return this}_onKeyPress(e){const t=e.code,i=e.charCode||e.keyCode;"Space"!==t&&"Enter"!==t&&32!==i&&13!==i||this.togglePopup()}_onMapClick(e){const t=e.originalEvent.target,i=this._element;this._popup&&(t===i||i.contains(t))&&this.togglePopup()}getPopup(){return this._popup}togglePopup(){const e=this._popup;return e?(e.isOpen()?(e.remove(),this._element.setAttribute("aria-expanded","false")):this._map&&(e.addTo(this._map),this._element.setAttribute("aria-expanded","true")),this):this}_behindTerrain(){const e=this._map,t=this._pos;if(!e||!t)return!1;const i=e.unproject(t),r=e.getFreeCameraOptions();if(!r.position)return!1;const n=r.position.toLngLat();return n.distanceTo(i)<.9*n.distanceTo(this._lngLat)}_evaluateOpacity(){const t=this._map;if(!t)return;const i=this._pos;if(!i||i.x<0||i.x>t.transform.width||i.y<0||i.y>t.transform.height)return void this._clearFadeTimer();const r=t.unproject(i);let n;t._showingGlobe()&&e.dc(t.transform,this._lngLat)?n=0:(n=1-t._queryFogOpacity(r),t.transform._terrainEnabled()&&t.getTerrain()&&this._behindTerrain()&&(n*=this._occludedOpacity)),this._element.style.opacity=`${n}`,this._element.style.pointerEvents=n>0?"auto":"none",this._popup&&this._popup._setOpacity(n),this._fadeTimer=null}_clearFadeTimer(){this._fadeTimer&&(clearTimeout(this._fadeTimer),this._fadeTimer=null)}_updateDOM(){const e=this._pos;if(!e||!this._map)return;const t=this._offset.mult(this._scale);this._element.style.transform=`\n translate(${e.x}px,${e.y}px)\n ${ks[this._anchor]}\n ${this._calculateXYTransform()} ${this._calculateZTransform()}\n translate(${t.x}px,${t.y}px)\n `}_calculateXYTransform(){const t=this._pos,i=this._map,r=this.getPitchAlignment();if(!i||!t||"map"!==r)return"";if(!i._showingGlobe()){const e=i.getPitch();return e?`rotateX(${e}deg)`:""}const n=e.b1(e.dd(i.transform,this._lngLat)),o=t.sub(e.de(i.transform)),s=Math.abs(o.x)+Math.abs(o.y);if(0===s)return"";const a=n/s;return`rotateX(${-o.y*a}deg) rotateY(${o.x*a}deg)`}_calculateZTransform(){const t=this._pos,i=this._map;if(!i||!t)return"";let r=0;const n=this.getRotationAlignment();if("map"===n)if(i._showingGlobe()){const t=i.project(new e.aJ(this._lngLat.lng,this._lngLat.lat+.001)),n=i.project(new e.aJ(this._lngLat.lng,this._lngLat.lat-.001)).sub(t);r=e.b1(Math.atan2(n.y,n.x))-90}else r=-i.getBearing();else if("horizon"===n){const n=e.a0(4,6,i.getZoom()),o=e.de(i.transform);o.y+=n*i.transform.height;const s=t.sub(o),a=e.b1(Math.atan2(s.y,s.x));r=(a>90?a-270:a+90)*(1-n)}return r+=this._rotation,r?`rotateZ(${r}deg)`:""}_update(e){cancelAnimationFrame(this._updateFrameId);const t=this._map;t&&(t.transform.renderWorldCopies&&(this._lngLat=Ls(this._lngLat,this._pos,t.transform)),this._pos=t.project(this._lngLat),!0===e?this._updateFrameId=requestAnimationFrame((()=>{this._element&&this._pos&&this._anchor&&(this._pos=this._pos.round(),this._updateDOM())})):this._pos=this._pos.round(),t._requestDomTask((()=>{this._map&&(this._element&&this._pos&&this._anchor&&this._updateDOM(),(t._showingGlobe()||t.getTerrain()||t.getFog())&&!this._fadeTimer&&(this._fadeTimer=window.setTimeout(this._evaluateOpacity.bind(this),60)))})))}getOffset(){return this._offset}setOffset(t){return this._offset=e.P.convert(t),this._update(),this}addClassName(e){return this._element.classList.add(e),this}removeClassName(e){return this._element.classList.remove(e),this}toggleClassName(e){return this._element.classList.toggle(e)}_onMove(t){const i=this._map;if(!i)return;const r=this._pointerdownPos,n=this._positionDelta;if(r&&n){if(!this._isDragging){const e=this._clickTolerance||i._clickTolerance;if(t.point.dist(r)=this._endTime)return this._end;const i=e.bb((t-this._startTime)/(this._endTime-this._startTime));return this._start*(1-i)+this._end*i}isEasing(e){return e>=this._startTime&&e<=this._endTime}jumpTo(e){this._startTime=-1/0,this._endTime=-1/0,this._start=e,this._end=e}easeTo(e,t,i){this._start=this.getValue(t),this._end=e,this._startTime=t,this._endTime=t+i}}const Us={"AttributionControl.ToggleAttribution":"Toggle attribution","FullscreenControl.Enter":"Enter fullscreen","FullscreenControl.Exit":"Exit fullscreen","GeolocateControl.FindMyLocation":"Find my location","GeolocateControl.LocationNotAvailable":"Location not available","LogoControl.Title":"Mapbox homepage","Map.Title":"Map","NavigationControl.ResetBearing":"Reset bearing to north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","ScrollZoomBlocker.CtrlMessage":"Use ctrl + scroll to zoom the map","ScrollZoomBlocker.CmdMessage":"Use \u2318 + scroll to zoom the map","TouchPanBlocker.Message":"Use two fingers to move the map"};class js{registerParameter(){}registerButton(){}registerBinding(){}refreshUI(){}}const $s={center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:85,interactive:!0,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,cooperativeGestures:!1,performanceMetricsCollection:!0,bearingSnap:7,clickTolerance:3,pitchWithRotate:!0,hash:!1,attributionControl:!0,antialias:!1,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,trackResize:!0,renderWorldCopies:!0,refreshExpiredTiles:!0,minTileCacheSize:null,maxTileCacheSize:null,localIdeographFontFamily:"sans-serif",localFontFamily:null,transformRequest:null,accessToken:null,fadeDuration:300,respectPrefersReducedMotion:!0,crossSourceCollisions:!0,collectResourceTiming:!1,testMode:!1,precompilePrograms:!0},Gs={showCompass:!0,showZoom:!0,visualizePitch:!1};class qs{constructor(t,i,r=!1){this._clickTolerance=10,this.element=i,this.mouseRotate=new is({clickTolerance:t.dragRotate._mouseRotate._clickTolerance}),this.map=t,r&&(this.mousePitch=new rs({clickTolerance:t.dragRotate._mousePitch._clickTolerance})),e.br(["mousedown","mousemove","mouseup","touchstart","touchmove","touchend","reset"],this),i.addEventListener("mousedown",this.mousedown),i.addEventListener("touchstart",this.touchstart,{passive:!1}),i.addEventListener("touchmove",this.touchmove),i.addEventListener("touchend",this.touchend),i.addEventListener("touchcancel",this.reset)}down(e,t){this.mouseRotate.mousedown(e,t),this.mousePitch&&this.mousePitch.mousedown(e,t),d()}move(e,t){const i=this.map,r=this.mouseRotate.mousemoveWindow(e,t),n=r&&r.bearingDelta;if(n&&i.setBearing(i.getBearing()+n),this.mousePitch){const r=this.mousePitch.mousemoveWindow(e,t),n=r&&r.pitchDelta;n&&i.setPitch(i.getPitch()+n)}}off(){const e=this.element;e.removeEventListener("mousedown",this.mousedown),e.removeEventListener("touchstart",this.touchstart,{passive:!1}),e.removeEventListener("touchmove",this.touchmove),e.removeEventListener("touchend",this.touchend),e.removeEventListener("touchcancel",this.reset),this.offTemp()}offTemp(){p(),window.removeEventListener("mousemove",this.mousemove),window.removeEventListener("mouseup",this.mouseup)}mousedown(t){this.down(e.Q({},t,{ctrlKey:!0,preventDefault:()=>t.preventDefault()}),_(this.element,t)),window.addEventListener("mousemove",this.mousemove),window.addEventListener("mouseup",this.mouseup)}mousemove(e){this.move(e,_(this.element,e))}mouseup(e){this.mouseRotate.mouseupWindow(e),this.mousePitch&&this.mousePitch.mouseupWindow(e),this.offTemp()}touchstart(e){1!==e.targetTouches.length?this.reset():(this._startPos=this._lastPos=g(this.element,e.targetTouches)[0],this.down({type:"mousedown",button:0,ctrlKey:!0,preventDefault:()=>e.preventDefault()},this._startPos))}touchmove(e){1!==e.targetTouches.length?this.reset():(this._lastPos=g(this.element,e.targetTouches)[0],this.move({preventDefault:()=>e.preventDefault()},this._lastPos))}touchend(e){0===e.targetTouches.length&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)t.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(null!=t.minPitch&&null!=t.maxPitch&&t.minPitch>t.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(null!=t.minPitch&&t.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(null!=t.maxPitch&&t.maxPitch>85)throw new Error("maxPitch must be less than or equal to 85");if(t.antialias&&e.dh(window)&&(t.antialias=!1,e.w("Antialiasing is disabled for this WebGL context to avoid browser bug: https://github.com/mapbox/mapbox-gl-js/issues/11609")),super(new pi(t.minZoom,t.maxZoom,t.minPitch,t.maxPitch,t.renderWorldCopies),t),this._repaint=!!t.repaint,this._interactive=t.interactive,this._minTileCacheSize=t.minTileCacheSize,this._maxTileCacheSize=t.maxTileCacheSize,this._failIfMajorPerformanceCaveat=t.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=t.preserveDrawingBuffer,this._antialias=t.antialias,this._trackResize=t.trackResize,this._bearingSnap=t.bearingSnap,this._refreshExpiredTiles=t.refreshExpiredTiles,this._fadeDuration=t.fadeDuration,this._isInitialLoad=!0,this._crossSourceCollisions=t.crossSourceCollisions,this._collectResourceTiming=t.collectResourceTiming,this._language=this._parseLanguage(t.language),this._worldview=t.worldview,this._renderTaskQueue=new Rs,this._domRenderTaskQueue=new Rs,this._controls=[],this._markers=[],this._popups=[],this._mapId=e.di(),this._locale=e.Q({},Us,t.locale),this._clickTolerance=t.clickTolerance,this._cooperativeGestures=t.cooperativeGestures,this._performanceMetricsCollection=t.performanceMetricsCollection,this._tessellationStep=t.tessellationStep,this._containerWidth=0,this._containerHeight=0,this._showParseStatus=!0,this._precompilePrograms=t.precompilePrograms,this._averageElevationLastSampledAt=-1/0,this._averageElevationExaggeration=0,this._averageElevation=new Vs(0),this._interactionRange=[1/0,-1/0],this._visibilityHidden=0,this._useExplicitProjection=!1,this._frameId=0,this._requestManager=new e.dj(t.transformRequest,t.accessToken,t.testMode),this._silenceAuthErrors=!!t.testMode,this._contextCreateOptions=t.contextCreateOptions?Object.assign({},t.contextCreateOptions):{},"string"==typeof t.container){const e=document.getElementById(t.container);if(!e)throw new Error(`Container '${t.container.toString()}' not found.`);this._container=e}else{if(!(t.container instanceof HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=t.container}if(this._container.childNodes.length>0&&e.w("The map container element should be empty, otherwise the map's interactivity will be negatively impacted. If you want to display a message when WebGL is not supported, use the Mapbox GL Supported plugin instead."),t.maxBounds&&this.setMaxBounds(t.maxBounds),e.br(["_onWindowOnline","_onWindowResize","_onVisibilityChange","_onMapScroll","_contextLost","_contextRestored"],this),this._setupContainer(),this._tp||(this._tp=new js),this._tp.registerParameter(this,["Debug"],"showOverdrawInspector"),this._tp.registerParameter(this,["Debug"],"showTileBoundaries"),this._tp.registerParameter(this,["Debug"],"showParseStatus"),this._tp.registerParameter(this,["Debug"],"repaint"),this._tp.registerParameter(this,["Debug"],"showTileAABBs"),this._tp.registerParameter(this,["Debug"],"showPadding"),this._tp.registerParameter(this,["Debug"],"showCollisionBoxes",{noSave:!0}),this._tp.registerParameter(this.transform,["Debug"],"freezeTileCoverage",{noSave:!0},(()=>{this._update()})),this._tp.registerParameter(this,["Debug","Wireframe"],"showTerrainWireframe"),this._tp.registerParameter(this,["Debug","Wireframe"],"showLayers2DWireframe"),this._tp.registerParameter(this,["Debug","Wireframe"],"showLayers3DWireframe"),this._setupPainter(),void 0===this.painter)throw new Error("Failed to initialize WebGL.");if(this.on("move",(()=>this._update(!1))),this.on("moveend",(()=>this._update(!1))),this.on("zoom",(()=>this._update(!0))),this._fullscreenchangeEvent="onfullscreenchange"in document?"fullscreenchange":"webkitfullscreenchange",window.addEventListener("online",this._onWindowOnline,!1),window.addEventListener("resize",this._onWindowResize,!1),window.addEventListener("orientationchange",this._onWindowResize,!1),window.addEventListener(this._fullscreenchangeEvent,this._onWindowResize,!1),window.addEventListener("visibilitychange",this._onVisibilityChange,!1),this.handlers=new Is(this,t),this._localFontFamily=t.localFontFamily,this._localIdeographFontFamily=t.localIdeographFontFamily,(t.style||!t.testMode)&&this.setStyle(t.style||e.db.DEFAULT_STYLE,{config:t.config,localFontFamily:this._localFontFamily,localIdeographFontFamily:this._localIdeographFontFamily}),t.projection&&this.setProjection(t.projection),t.hash&&(this._hash=new Ro("string"==typeof t.hash&&t.hash||void 0).addTo(this)),!this._hash||!this._hash._onHashChange()){null==i.center&&null==i.zoom||(this.transform._unmodified=!1),this.jumpTo({center:t.center,zoom:t.zoom,bearing:t.bearing,pitch:t.pitch});const r=t.bounds;r&&(this.resize(),this.fitBounds(r,e.Q({},t.fitBoundsOptions,{duration:0})))}this.resize(),t.attributionControl&&this.addControl(new zs({customAttribution:t.customAttribution})),this._logoControl=new Ds,this.addControl(this._logoControl,t.logoPosition),this.on("style.load",(()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet),this._postStyleLoadEvent()})),this.on("data",(t=>{this._update("style"===t.dataType),this.fire(new e.g(`${t.dataType}data`,t))})),this.on("dataloading",(t=>{this.fire(new e.g(`${t.dataType}dataloading`,t))}))}_getMapId(){return this._mapId}addControl(t,i){if(void 0===i&&(i=t.getDefaultPosition?t.getDefaultPosition():"top-right"),!t||!t.onAdd)return this.fire(new e.f(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));const r=t.onAdd(this);this._controls.push(t);const n=this._controlPositions[i];return-1!==i.indexOf("bottom")?n.insertBefore(r,n.firstChild):n.appendChild(r),this}removeControl(t){if(!t||!t.onRemove)return this.fire(new e.f(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));const i=this._controls.indexOf(t);return i>-1&&this._controls.splice(i,1),t.onRemove(this),this}hasControl(e){return this._controls.indexOf(e)>-1}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}resize(t){if(this._updateContainerDimensions(),this._containerWidth===this.transform.width&&this._containerHeight===this.transform.height)return this;this._resizeCanvas(this._containerWidth,this._containerHeight),this.transform.resize(this._containerWidth,this._containerHeight),this.painter.resize(Math.ceil(this._containerWidth),Math.ceil(this._containerHeight));const i=!this._moving;return i&&this.fire(new e.g("movestart",t)).fire(new e.g("move",t)),this.fire(new e.g("resize",t)),i&&this.fire(new e.g("moveend",t)),this}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()||null}setMaxBounds(t){return this.transform.setMaxBounds(e.aj.convert(t)),this._update()}setMinZoom(t){if((t=t??-2)>=-2&&t<=this.transform.maxZoom)return this.transform.minZoom=t,this._update(),this.getZoom()=this.transform.minZoom)return this.transform.maxZoom=t,this._update(),this.getZoom()>t?this.setZoom(t):this.fire(new e.g("zoomstart")).fire(new e.g("zoom")).fire(new e.g("zoomend")),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(t){if((t=t??0)<0)throw new Error("minPitch must be greater than or equal to 0");if(t>=0&&t<=this.transform.maxPitch)return this.transform.minPitch=t,this._update(),this.getPitch()85)throw new Error("maxPitch must be less than or equal to 85");if(t>=this.transform.minPitch)return this.transform.maxPitch=t,this._update(),this.getPitch()>t?this.setPitch(t):this.fire(new e.g("pitchstart")).fire(new e.g("pitch")).fire(new e.g("pitchend")),this;throw new Error("maxPitch must be greater than or equal to minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(e){return this.transform.renderWorldCopies=e,this.transform.renderWorldCopies||this._forceMarkerAndPopupUpdate(!0),this._update()}getLanguage(){return this._language}_parseLanguage(e){return"auto"===e?navigator.language:Array.isArray(e)?0===e.length?void 0:e.map((e=>"auto"===e?navigator.language:e)):e}setLanguage(e){const t=this._parseLanguage(e);if(!this.style||t===this._language)return this;this._language=t,this.style.reloadSources();for(const e of this._controls)e._setLanguage&&e._setLanguage(this._language);return this}getWorldview(){return this._worldview}setWorldview(e){return this.style&&e!==this._worldview?(this._worldview=e,this.style.reloadSources(),this):this}getProjection(){return this.transform.mercatorFromTransition?{name:"globe",center:[0,0]}:this.transform.getProjection()}_showingGlobe(){return"globe"===this.transform.projection.name}setProjection(e){return this._lazyInitEmptyStyle(),e?"string"==typeof e&&(e={name:e}):e=null,this._useExplicitProjection=!!e,this._prioritizeAndUpdateProjection(e,this.style.projection)}_updateProjectionTransition(){if("globe"!==this.getProjection().name)return;const t=this.transform,i=t.projection.name;let r;"globe"===i&&t.zoom>=e.aV?(t.setMercatorFromTransition(),r=!0):"mercator"===i&&t.zoom=e.aV?this.transform.setMercatorFromTransition():this.transform.setProjection(t),this.style.applyProjectionUpdate(),i&&(this.painter.clearBackgroundTiles(),this.style.clearSources(),this._update(!0),this._forceMarkerAndPopupUpdate(!0)),this}project(t){return this.transform.locationPoint3D(e.aJ.convert(t))}unproject(t){return this.transform.pointLocation3D(e.P.convert(t))}isMoving(){return this._moving||this.handlers&&this.handlers.isMoving()||!1}isZooming(){return this._zooming||this.handlers&&this.handlers.isZooming()||!1}isRotating(){return this._rotating||this.handlers&&this.handlers.isRotating()||!1}_isDragging(){return this.handlers&&this.handlers._isDragging()||!1}_createDelegatedListener(e,t,i){if("mouseenter"===e||"mouseover"===e){let r=!1;const n=n=>{const o=t.filter((e=>this.getLayer(e))),s=o.length?this.queryRenderedFeatures(n.point,{layers:o}):[];s.length?r||(r=!0,i.call(this,new $o(e,this,n.originalEvent,{features:s}))):r=!1},o=()=>{r=!1};return{layers:new Set(t),listener:i,delegates:{mousemove:n,mouseout:o}}}if("mouseleave"===e||"mouseout"===e){let r=!1;const n=n=>{const o=t.filter((e=>this.getLayer(e)));(o.length?this.queryRenderedFeatures(n.point,{layers:o}):[]).length?r=!0:r&&(r=!1,i.call(this,new $o(e,this,n.originalEvent)))},o=t=>{r&&(r=!1,i.call(this,new $o(e,this,t.originalEvent)))};return{layers:new Set(t),listener:i,delegates:{mousemove:n,mouseout:o}}}{const r=e=>{const r=t.filter((e=>this.getLayer(e))),n=r.length?this.queryRenderedFeatures(e.point,{layers:r}):[];n.length&&(e.features=n,i.call(this,e),delete e.features)};return{layers:new Set(t),listener:i,delegates:{[e]:r}}}}on(e,t,i){if("function"==typeof t||void 0===i)return super.on(e,t);if(Array.isArray(t)||(t=[t]),t)for(const e of t)if(!this._isValidId(e))return this;const r=this._createDelegatedListener(e,t,i);this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[e]=this._delegatedListeners[e]||[],this._delegatedListeners[e].push(r);for(const e in r.delegates)this.on(e,r.delegates[e]);return this}once(e,t,i){if("function"==typeof t||void 0===i)return super.once(e,t);if(Array.isArray(t)||(t=[t]),t)for(const e of t)if(!this._isValidId(e))return this;const r=this._createDelegatedListener(e,t,i);for(const e in r.delegates)this.once(e,r.delegates[e]);return this}off(e,t,i){if("function"==typeof t||void 0===i)return super.off(e,t);const r=new Set(Array.isArray(t)?t:[t]);for(const e of r)if(!this._isValidId(e))return this;const n=(e,t)=>{if(e.size!==t.size)return!1;for(const i of e)if(!t.has(i))return!1;return!0},o=this._delegatedListeners?this._delegatedListeners[e]:void 0;return o&&(e=>{for(let t=0;t{r?(e.w(`Unable to perform style diff: ${String(r.message||r.error||r)}. Rebuilding the style from scratch.`),this._updateStyle(t,i)):n&&this._update(!0)}),(()=>{this._postStyleLoadEvent()})),this):(this._localIdeographFontFamily=i.localIdeographFontFamily,this._localFontFamily=i.localFontFamily,this._updateStyle(t,i))}_getUIString(e){const t=this._locale[e];if(null==t)throw new Error(`Missing UI string '${e}'`);return t}_updateStyle(t,i){if(this.style&&(this.style.setEventedParent(null),this.style._remove(),this.style=void 0),t){const r=e.Q({},i);i&&i.config&&(r.initialConfig=i.config,delete r.config),this.style=new zo(this,r).load(t),this.style.setEventedParent(this,{style:this.style})}return this._updateTerrain(),this}_lazyInitEmptyStyle(){this.style||(this.style=new zo(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():(e.w("There is no style added to the map."),!1)}_isValidId(t){return null==t?(this.fire(new e.f(new Error("IDs can't be empty."))),!1):!e.cY(t)||(this.fire(new e.f(new Error(`IDs can't contain special symbols: "${t}".`))),!1)}addSource(e,t){return this._isValidId(e)?(this._lazyInitEmptyStyle(),this.style.addSource(e,t),this._update(!0)):this}isSourceLoaded(e){return!!this._isValidId(e)&&!!this.style&&this.style._isSourceCacheLoaded(e)}areTilesLoaded(){return this.style.areTilesLoaded()}addSourceType(e,t,i){this._lazyInitEmptyStyle(),this.style.addSourceType(e,t,i)}removeSource(e){return this._isValidId(e)?(this.style.removeSource(e),this._updateTerrain(),this._update(!0)):this}getSource(e){return this._isValidId(e)?this.style.getOwnSource(e):null}addImage(t,i,{pixelRatio:r=1,sdf:n=!1,stretchX:o,stretchY:s,content:a}={}){if(this._lazyInitEmptyStyle(),i instanceof HTMLImageElement||ImageBitmap&&i instanceof ImageBitmap){const{width:l,height:c,data:h}=e.e.getImageData(i);this.style.addImage(t,{data:new e.j({width:l,height:c},h),pixelRatio:r,stretchX:o,stretchY:s,content:a,sdf:n,version:0})}else if(void 0===i.width||void 0===i.height)this.fire(new e.f(new Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));else{const{width:l,height:c}=i,h=i;this.style.addImage(t,{data:new e.j({width:l,height:c},new Uint8Array(h.data)),pixelRatio:r,stretchX:o,stretchY:s,content:a,sdf:n,version:0,userImage:h}),h.onAdd&&h.onAdd(this,t)}}updateImage(t,i){this._lazyInitEmptyStyle();const r=this.style.getImage(t);if(!r)return void this.fire(new e.f(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));const n=i instanceof HTMLImageElement||ImageBitmap&&i instanceof ImageBitmap?e.e.getImageData(i):i,{width:o,height:s,data:a}=n;if(void 0===o||void 0===s)return void this.fire(new e.f(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(o!==r.data.width||s!==r.data.height)return void this.fire(new e.f(new Error(`The width and height of the updated image (${o}, ${s})\n must be that same as the previous version of the image\n (${r.data.width}, ${r.data.height})`)));const l=!(i instanceof HTMLImageElement||ImageBitmap&&i instanceof ImageBitmap);r.data.replace(a,l),this.style.updateImage(t,r)}hasImage(t){return t?!!this.style&&!!this.style.getImage(t):(this.fire(new e.f(new Error("Missing required image id"))),!1)}removeImage(e){this.style.removeImage(e)}loadImage(t,i){e.i(this._requestManager.transformRequest(t,e.R.Image),((t,r)=>{i(t,r instanceof HTMLImageElement?e.e.getImageData(r):r)}))}listImages(){return this.style.listImages()}addModel(e,t){this._lazyInitEmptyStyle(),this.style.addModel(e,t)}hasModel(t){return t?this.style.hasModel(t):(this.fire(new e.f(new Error("Missing required model id"))),!1)}removeModel(e){this.style.removeModel(e)}listModels(){return this.style.listModels()}addLayer(e,t){return this._isValidId(e.id)?(this._lazyInitEmptyStyle(),this.style.addLayer(e,t),this._update(!0)):this}getSlot(e){const t=this.getLayer(e);return t&&t.slot||null}setSlot(e,t){return this.style.setSlot(e,t),this.style.mergeLayers(),this._update(!0)}addImport(e,t){return this.style.addImport(e,t),this}updateImport(e,t){return"string"!=typeof t&&t.id!==e?(this.removeImport(e),this.addImport(t)):(this.style.updateImport(e,t),this._update(!0))}removeImport(e){return this.style.removeImport(e),this}moveImport(e,t){return this.style.moveImport(e,t),this._update(!0)}moveLayer(e,t){return this._isValidId(e)?(this.style.moveLayer(e,t),this._update(!0)):this}removeLayer(e){return this._isValidId(e)?(this.style.removeLayer(e),this._update(!0)):this}getLayer(e){if(!this._isValidId(e))return null;const t=this.style.getOwnLayer(e);return t?"custom"===t.type?t.implementation:t.serialize():void 0}getSlots(){return this.style.getSlots()}setLayerZoomRange(e,t,i){return this._isValidId(e)?(this.style.setLayerZoomRange(e,t,i),this._update(!0)):this}setFilter(e,t,i={}){return this._isValidId(e)?(this.style.setFilter(e,t,i),this._update(!0)):this}getFilter(e){return this._isValidId(e)?this.style.getFilter(e):null}setPaintProperty(e,t,i,r={}){return this._isValidId(e)?(this.style.setPaintProperty(e,t,i,r),this._update(!0)):this}getPaintProperty(e,t){return this._isValidId(e)?this.style.getPaintProperty(e,t):null}setLayoutProperty(e,t,i,r={}){return this._isValidId(e)?(this.style.setLayoutProperty(e,t,i,r),this._update(!0)):this}getLayoutProperty(e,t){return this._isValidId(e)?this.style.getLayoutProperty(e,t):null}getSchema(e){return this.style.getSchema(e)}setSchema(e,t){return this.style.setSchema(e,t),this._update(!0)}getConfig(e){return this.style.getConfig(e)}setConfig(e,t){return this.style.setConfig(e,t),this._update(!0)}getConfigProperty(e,t){return this.style.getConfigProperty(e,t)}setConfigProperty(e,t,i){return this.style.setConfigProperty(e,t,i),this._update(!0)}setLights(e){if(this._lazyInitEmptyStyle(),e&&1===e.length&&"flat"===e[0].type){const t=e[0];t.properties?this.style.setFlatLight(t.properties,t.id,{}):this.style.setFlatLight({},"flat")}else this.style.setLights(e),this.painter.terrain&&(this.painter.terrain.invalidateRenderCache=!0);return this._update(!0)}getLights(){const e=this.style.getLights()||[];return 0===e.length&&e.push({id:this.style.light.id,type:"flat",properties:this.style.getFlatLight()}),e}setLight(e,t={}){return console.log("The `map.setLight` function is deprecated, prefer using `map.setLights` with `flat` light type instead."),this.setLights([{id:"flat",type:"flat",properties:e}])}getLight(){return console.log("The `map.getLight` function is deprecated, prefer using `map.getLights` instead."),this.style.getFlatLight()}setTerrain(e){return this._lazyInitEmptyStyle(),!e&&this.transform.projection.requiresDraping?this.style.setTerrainForDraping():this.style.setTerrain(e),this._averageElevationLastSampledAt=-1/0,this._update(!0)}getTerrain(){return this.style?this.style.getTerrain():null}setFog(e){return this._lazyInitEmptyStyle(),this.style.setFog(e),this._update(!0)}getFog(){return this.style?this.style.getFog():null}setColorTheme(e){return this._lazyInitEmptyStyle(),this.style.setColorTheme(e),this._update(!0)}setCamera(e){return this.style.setCamera(e),this._triggerCameraUpdate(e)}_triggerCameraUpdate(e){return this._update(this.transform.setOrthographicProjectionAtLowPitch("orthographic"===e["camera-projection"]))}getCamera(){return this.style.camera}_queryFogOpacity(t){return this.style&&this.style.fog?this.style.fog.getOpacityAtLatLng(e.aJ.convert(t),this.transform):0}setFeatureState(e,t){return this._isValidId(e.source)?(this.style.setFeatureState(e,t),this._update()):this}removeFeatureState(e,t){return this._isValidId(e.source)?(this.style.removeFeatureState(e,t),this._update()):this}getFeatureState(e){return this._isValidId(e.source)?this.style.getFeatureState(e):null}_updateContainerDimensions(){if(!this._container)return;const e=this._container.getBoundingClientRect().width||400,t=this._container.getBoundingClientRect().height||300;let i,r,n,o=this._container;for(;o&&(!r||!n);){const e=window.getComputedStyle(o).transform;e&&"none"!==e&&(i=e.match(/matrix.*\((.+)\)/)[1].split(", "),i[0]&&"0"!==i[0]&&"1"!==i[0]&&(r=i[0]),i[3]&&"0"!==i[3]&&"1"!==i[3]&&(n=i[3])),o=o.parentElement}this._containerWidth=r?Math.abs(e/r):e,this._containerHeight=n?Math.abs(t/n):t}_detectMissingCSS(){"rgb(250, 128, 114)"!==window.getComputedStyle(this._missingCSSCanary).getPropertyValue("background-color")&&e.w("This page appears to be missing CSS declarations for Mapbox GL JS, which may cause the map to display incorrectly. Please ensure your page includes mapbox-gl.css, as described in https://www.mapbox.com/mapbox-gl-js/api/.")}_setupContainer(){const e=this._container;e.classList.add("mapboxgl-map"),(this._missingCSSCanary=n("div","mapboxgl-canary",e)).style.visibility="hidden",this._detectMissingCSS();const t=this._canvasContainer=n("div","mapboxgl-canvas-container",e);this._canvas=n("canvas","mapboxgl-canvas",t),this._interactive&&(t.classList.add("mapboxgl-interactive"),this._canvas.setAttribute("tabindex","0")),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("aria-label",this._getUIString("Map.Title")),this._canvas.setAttribute("role","region"),this._updateContainerDimensions(),this._resizeCanvas(this._containerWidth,this._containerHeight);const i=this._controlContainer=n("div","mapboxgl-control-container",e),r=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach((e=>{r[e]=n("div",`mapboxgl-ctrl-${e}`,i)})),this._container.addEventListener("scroll",this._onMapScroll,!1)}_resizeCanvas(t,i){const r=e.e.devicePixelRatio||1;this._canvas.width=r*Math.ceil(t),this._canvas.height=r*Math.ceil(i),this._canvas.style.width=`${t}px`,this._canvas.style.height=`${i}px`}_addMarker(e){this._markers.push(e)}_removeMarker(e){const t=this._markers.indexOf(e);-1!==t&&this._markers.splice(t,1)}_addPopup(e){this._popups.push(e)}_removePopup(e){const t=this._popups.indexOf(e);-1!==t&&this._popups.splice(t,1)}_setupPainter(){const i=e.Q({},t.webGLContextAttributes,{failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1}),r=this._canvas.getContext("webgl2",i);r?(e.dk(r,!0),this.painter=new In(r,this._contextCreateOptions,this.transform,this._tp),this.on("data",(e=>{"source"===e.dataType&&this.painter.setTileLoadedFlag(!0)})),e.dl.testSupport(r)):this.fire(new e.f(new Error("Failed to initialize WebGL")))}_contextLost(t){t.preventDefault(),this._frame&&(this._frame.cancel(),this._frame=null),this.fire(new e.g("webglcontextlost",{originalEvent:t}))}_contextRestored(t){this._setupPainter(),this.resize(),this._update(),this.fire(new e.g("webglcontextrestored",{originalEvent:t}))}_onMapScroll(e){if(e.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1}idle(){return!this.isMoving()&&this.loaded()}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}frameReady(){return this.loaded()&&!this._placementDirty}_update(e){return this.style?(this._styleDirty=this._styleDirty||e,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(e){return this._update(),this._renderTaskQueue.add(e)}_cancelRenderFrame(e){this._renderTaskQueue.remove(e)}_requestDomTask(e){!this.loaded()||this.loaded()&&!this.isMoving()?e():this._domRenderTaskQueue.add(e)}_render(t){let i;this.fire(new e.g("renderstart")),++this._frameId;const r=this.painter.context.extTimerQuery,n=e.e.now(),o=this.painter.context.gl;if(this.listens("gpu-timing-frame")&&(i=o.createQuery(),o.beginQuery(r.TIME_ELAPSED_EXT,i)),this.painter.context.setDirty(),this.painter.setBaseState(),(this.isMoving()||this.isRotating()||this.isZooming())&&(this._interactionRange[0]=Math.min(this._interactionRange[0],performance.now()),this._interactionRange[1]=Math.max(this._interactionRange[1],performance.now())),this._renderTaskQueue.run(t),this._domRenderTaskQueue.run(t),this._removed)return;this._updateProjectionTransition();const s=this._isInitialLoad?0:this._fadeDuration;if(this.style&&this._styleDirty){this._styleDirty=!1;const t=this.transform.zoom,i=this.transform.pitch,r=e.e.now(),n=new e.Y(t,{now:r,fadeDuration:s,pitch:i,transition:this.style.transition});this.style.update(n)}this.style&&this.style.hasFogTransition()&&(this.style._markersNeedUpdate=!0,this._sourcesDirty=!0);let a=!1;this.style&&this._sourcesDirty?(this._sourcesDirty=!1,this.painter._updateFog(this.style),this._updateTerrain(),a=this._updateAverageElevation(n),this.style.updateSources(this.transform),this._forceMarkerAndPopupUpdate()):a=this._updateAverageElevation(n);const l=this.style&&this.style._updatePlacement(this.painter,this.painter.transform,this.showCollisionBoxes,s,this._crossSourceCollisions,this.painter.replacementSource);if(l&&(this._placementDirty=l.needsRerender),this.style&&this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showParseStatus:this.showParseStatus,wireframe:{terrain:this.showTerrainWireframe,layers2D:this.showLayers2DWireframe,layers3D:this.showLayers3DWireframe},showOverdrawInspector:this._showOverdrawInspector,showQueryGeometry:!!this._showQueryGeometry,showTileAABBs:this.showTileAABBs,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:s,isInitialLoad:this._isInitialLoad,showPadding:this.showPadding,gpuTiming:!!this.listens("gpu-timing-layer"),gpuTimingDeferredRender:!!this.listens("gpu-timing-deferred-render"),speedIndexTiming:this.speedIndexTiming}),this.fire(new e.g("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,e.df.mark(e.dg.load),this.fire(new e.g("load"))),this.style&&this.style.hasTransitions()&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles(),i){const t=e.e.now()-n;o.endQuery(r.TIME_ELAPSED_EXT),setTimeout((()=>{const r=o.getQueryParameter(i,o.QUERY_RESULT)/1e6;o.deleteQuery(i),this.fire(new e.g("gpu-timing-frame",{cpuTime:t,gpuTime:r}))}),50)}if(this.listens("gpu-timing-layer")){const t=this.painter.collectGpuTimers();setTimeout((()=>{const i=this.painter.queryGpuTimers(t);this.fire(new e.g("gpu-timing-layer",{layerTimes:i}))}),50)}if(this.listens("gpu-timing-deferred-render")){const t=this.painter.collectDeferredRenderGpuQueries();setTimeout((()=>{const i=this.painter.queryGpuTimeDeferredRender(t);this.fire(new e.g("gpu-timing-deferred-render",{gpuTime:i}))}),50)}const c=this._sourcesDirty||this._styleDirty||this._placementDirty||a;if(c||this._repaint)this.triggerRepaint();else{const t=this.idle();if(t&&(a=this._updateAverageElevation(n,!0)),a)this.triggerRepaint();else if(this._triggerFrame(!1),t&&(this.fire(new e.g("idle")),this._isInitialLoad=!1,this.speedIndexTiming)){const t=this._calculateSpeedIndex();this.fire(new e.g("speedindexcompleted",{speedIndex:t})),this.speedIndexTiming=!1}}!this._loaded||this._fullyLoaded||c||(this._fullyLoaded=!0,e.df.mark(e.dg.fullLoad),this._performanceMetricsCollection&&e.dm(this._requestManager._customAccessToken,{width:this.painter.width,height:this.painter.height,interactionRange:this._interactionRange,visibilityHidden:this._visibilityHidden,terrainEnabled:!!this.painter.style.getTerrain(),fogEnabled:!!this.painter.style.getFog(),projection:this.getProjection().name,zoom:this.transform.zoom,renderer:this.painter.context.renderer,vendor:this.painter.context.vendor}),this._authenticate())}_forceMarkerAndPopupUpdate(e){for(const t of this._markers)e&&!this.getRenderWorldCopies()&&(t._lngLat=t._lngLat.wrap()),t._update();for(const t of this._popups)!e||this.getRenderWorldCopies()||t._trackPointer||(t._lngLat=t._lngLat.wrap()),t._update()}_updateAverageElevation(e,t=!1){const i=e=>(this.transform.averageElevation=e,this._update(!1),!0);if(!this.painter.averageElevationNeedsEasing())return 0!==this.transform.averageElevation&&i(0);const r=this.transform.elevation&&this.transform.elevation.exaggeration()!==this._averageElevationExaggeration;if(r||(t||e-this._averageElevationLastSampledAt>500)&&!this._averageElevation.isEasing(e)){const t=this.transform.averageElevation;let n=this.transform.sampleAverageElevation();null!=this.transform.elevation&&(this._averageElevationExaggeration=this.transform.elevation.exaggeration()),isNaN(n)?n=0:this._averageElevationLastSampledAt=e;const o=Math.abs(t-n);if(o>1){if(this._isInitialLoad||r)return this._averageElevation.jumpTo(n),i(n);this._averageElevation.easeTo(n,e,300)}else if(o>1e-4)return this._averageElevation.jumpTo(n),i(n)}return!!this._averageElevation.isEasing(e)&&i(this._averageElevation.getValue(e))}_authenticate(){e.dn(this._getMapId(),this._requestManager._skuToken,this._requestManager._customAccessToken,(t=>{if(t&&(t.message===e.dp||401===t.status)){const t=this.painter.context.gl;e.dk(t,!1),this._logoControl instanceof Ds&&this._logoControl._updateLogo(),t&&t.clear(t.DEPTH_BUFFER_BIT|t.COLOR_BUFFER_BIT|t.STENCIL_BUFFER_BIT),this._silenceAuthErrors||this.fire(new e.f(new Error("A valid Mapbox access token is required to use Mapbox GL JS. To create an account or a new access token, visit https://account.mapbox.com/")))}})),e.dq(this._getMapId(),this._requestManager._skuToken,this._requestManager._customAccessToken,(()=>{}))}_postStyleLoadEvent(){this.style.globalId&&e.dr(this._requestManager._customAccessToken,{map:this,skuToken:this._requestManager._skuToken,style:this.style.globalId,importedStyles:this.style.getImportGlobalIds()})}_updateTerrain(){const e=this._isDragging();this.painter.updateTerrain(this.style,e)}_calculateSpeedIndex(){const e=this.painter.canvasCopy(),t=this.painter.getCanvasCopiesAndTimestamps();t.timeStamps.push(performance.now());const i=this.painter.context.gl,r=i.createFramebuffer();function n(e){i.framebufferTexture2D(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0,i.TEXTURE_2D,e,0);const t=new Uint8Array(i.drawingBufferWidth*i.drawingBufferHeight*4);return i.readPixels(0,0,i.drawingBufferWidth,i.drawingBufferHeight,i.RGBA,i.UNSIGNED_BYTE,t),t}return i.bindFramebuffer(i.FRAMEBUFFER,r),this._canvasPixelComparison(n(e),t.canvasCopies.map(n),t.timeStamps)}_canvasPixelComparison(e,t,i){let r=i[1]-i[0];const n=e.length/4;for(let o=0;o{const t=!!this._renderNextFrame;this._frame=null,this._renderNextFrame=null,t&&this._render(e)})))}_preloadTiles(t){const i=this.style?this.style.getSourceCaches():[];return e.dv(i,((e,i)=>e._preloadTiles(t,i)),(()=>{this.triggerRepaint()})),this}_onWindowOnline(){this._update()}_onWindowResize(e){this._trackResize&&this.resize({originalEvent:e})._update()}_onVisibilityChange(){"hidden"===document.visibilityState&&this._visibilityHidden++}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(e){this._showTileBoundaries!==e&&(this._showTileBoundaries=e,this._tp.refreshUI(),this._update())}get showParseStatus(){return!!this._showParseStatus}set showParseStatus(e){this._showParseStatus!==e&&(this._showParseStatus=e,this._tp.refreshUI(),this._update())}get showTerrainWireframe(){return!!this._showTerrainWireframe}set showTerrainWireframe(e){this._showTerrainWireframe!==e&&(this._showTerrainWireframe=e,this._tp.refreshUI(),this._update())}get showLayers2DWireframe(){return!!this._showLayers2DWireframe}set showLayers2DWireframe(e){this._showLayers2DWireframe!==e&&(this._showLayers2DWireframe=e,this._tp.refreshUI(),this._update())}get showLayers3DWireframe(){return!!this._showLayers3DWireframe}set showLayers3DWireframe(e){this._showLayers3DWireframe!==e&&(this._showLayers3DWireframe=e,this._tp.refreshUI(),this._update())}get speedIndexTiming(){return!!this._speedIndexTiming}set speedIndexTiming(e){this._speedIndexTiming!==e&&(this._speedIndexTiming=e,this._update())}get showPadding(){return!!this._showPadding}set showPadding(e){this._showPadding!==e&&(this._showPadding=e,this._tp.refreshUI(),this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(e){this._showCollisionBoxes!==e&&(this._showCollisionBoxes=e,this._tp.refreshUI(),e?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(e){this._showOverdrawInspector!==e&&(this._showOverdrawInspector=e,this._tp.refreshUI(),this._update())}get repaint(){return!!this._repaint}set repaint(e){this._repaint!==e&&(this._repaint=e,this._tp.refreshUI(),this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(e){this._vertices=e,this._update()}get showTileAABBs(){return!!this._showTileAABBs}set showTileAABBs(e){this._showTileAABBs!==e&&(this._showTileAABBs=e,this._tp.refreshUI(),e&&this._update())}_setCacheLimits(t,i){e.dx(t,i)}get version(){return e.dw}},NavigationControl:class{constructor(t={}){this.options=e.Q({},Gs,t),this._container=n("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._container.addEventListener("contextmenu",(e=>e.preventDefault())),this.options.showZoom&&(e.br(["_setButtonTitle","_updateZoomButtons"],this),this._zoomInButton=this._createButton("mapboxgl-ctrl-zoom-in",(e=>{this._map&&this._map.zoomIn({},{originalEvent:e})})),n("span","mapboxgl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("mapboxgl-ctrl-zoom-out",(e=>{this._map&&this._map.zoomOut({},{originalEvent:e})})),n("span","mapboxgl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(e.br(["_rotateCompassArrow"],this),this._compass=this._createButton("mapboxgl-ctrl-compass",(e=>{const t=this._map;t&&(this.options.visualizePitch?t.resetNorthPitch({},{originalEvent:e}):t.resetNorth({},{originalEvent:e}))})),this._compassIcon=n("span","mapboxgl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}_updateZoomButtons(){const e=this._map;if(!e)return;const t=e.getZoom(),i=t===e.getMaxZoom(),r=t===e.getMinZoom();this._zoomInButton.disabled=i,this._zoomOutButton.disabled=r,this._zoomInButton.setAttribute("aria-disabled",i.toString()),this._zoomOutButton.setAttribute("aria-disabled",r.toString())}_rotateCompassArrow(){const e=this._map;if(!e)return;const t=this.options.visualizePitch?`scale(${1/Math.pow(Math.cos(e.transform.pitch*(Math.PI/180)),.5)}) rotateX(${e.transform.pitch}deg) rotateZ(${e.transform.angle*(180/Math.PI)}deg)`:`rotate(${e.transform.angle*(180/Math.PI)}deg)`;e._requestDomTask((()=>{this._compassIcon&&(this._compassIcon.style.transform=t)}))}onAdd(e){return this._map=e,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),e.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&e.on("pitch",this._rotateCompassArrow),e.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new qs(e,this._compass,this.options.visualizePitch)),this._container}onRemove(){const e=this._map;e&&(this._container.remove(),this.options.showZoom&&e.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&e.off("pitch",this._rotateCompassArrow),e.off("rotate",this._rotateCompassArrow),this._handler&&this._handler.off(),this._handler=void 0),this._map=void 0)}_createButton(e,t){const i=n("button",e,this._container);return i.type="button",i.addEventListener("click",t),i}_setButtonTitle(e,t){if(!this._map)return;const i=this._map._getUIString(`NavigationControl.${t}`);e.setAttribute("aria-label",i),e.firstElementChild&&e.firstElementChild.setAttribute("title",i)}},GeolocateControl:class extends e.E{constructor(t={}){super();const i=navigator.geolocation;this.options=e.Q({geolocation:i},Zs,t),e.br(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker","_updateMarkerRotation","_onDeviceOrientation"],this),this._updateMarkerRotationThrottled=Do(this._updateMarkerRotation,20),this._numberOfWatches=0}onAdd(e){return this._map=e,this._container=n("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkGeolocationSupport(this._setupUI),this._container}onRemove(){void 0!==this._geolocationWatchID&&(this.options.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),this._container.remove(),this._map.off("zoom",this._onZoom),this._map=void 0,this._numberOfWatches=0,this._noTimeout=!1}_checkGeolocationSupport(e){const t=(t=!!this.options.geolocation)=>{this._supportsGeolocation=t,e(t)};void 0!==this._supportsGeolocation?e(this._supportsGeolocation):void 0!==navigator.permissions?navigator.permissions.query({name:"geolocation"}).then((e=>t("denied"!==e.state))).catch((()=>t())):t()}_isOutOfMapMaxBounds(e){const t=this._map.getMaxBounds(),i=e.coords;return!!t&&(i.longitudet.getEast()||i.latitudet.getNorth())}_setErrorState(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting")}}_onSuccess(t){if(this._map){if(this._isOutOfMapMaxBounds(t))return this._setErrorState(),this.fire(new e.g("outofmaxbounds",t)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=t,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background")}this.options.showUserLocation&&"OFF"!==this._watchState&&this._updateMarker(t),this.options.trackUserLocation&&"ACTIVE_LOCK"!==this._watchState||this._updateCamera(t),this.options.showUserLocation&&this._userLocationDotMarker.removeClassName("mapboxgl-user-location-dot-stale"),this.fire(new e.g("geolocate",t)),this._finish()}}_updateCamera(t){const i=new e.aJ(t.coords.longitude,t.coords.latitude),r=t.coords.accuracy,n=this._map.getBearing(),o=e.Q({bearing:n},this.options.fitBoundsOptions);this._map.fitBounds(i.toBounds(r),o,{geolocateSource:!0})}_updateMarker(t){if(t){const i=new e.aJ(t.coords.longitude,t.coords.latitude);this._accuracyCircleMarker.setLngLat(i).addTo(this._map),this._userLocationDotMarker.setLngLat(i).addTo(this._map),this._accuracy=t.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()}_updateCircleRadius(){const t=this._map.transform,i=e.ay(1,t._center.lat)*t.worldSize,r=Math.ceil(2*this._accuracy*i);this._circleElement.style.width=`${r}px`,this._circleElement.style.height=`${r}px`}_onZoom(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}_updateMarkerRotation(){this._userLocationDotMarker&&"number"==typeof this._heading?(this._userLocationDotMarker.setRotation(this._heading),this._userLocationDotMarker.addClassName("mapboxgl-user-location-show-heading")):(this._userLocationDotMarker.removeClassName("mapboxgl-user-location-show-heading"),this._userLocationDotMarker.setRotation(0))}_onError(t){if(this._map){if(this.options.trackUserLocation)if(1===t.code){this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;const e=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.setAttribute("aria-label",e),this._geolocateButton.firstElementChild&&this._geolocateButton.firstElementChild.setAttribute("title",e),void 0!==this._geolocationWatchID&&this._clearWatch()}else{if(3===t.code&&this._noTimeout)return;this._setErrorState()}"OFF"!==this._watchState&&this.options.showUserLocation&&this._userLocationDotMarker.addClassName("mapboxgl-user-location-dot-stale"),this.fire(new e.g("error",t)),this._finish()}}_finish(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0}_setupUI(t){if(void 0!==this._map){if(this._container.addEventListener("contextmenu",(e=>e.preventDefault())),this._geolocateButton=n("button","mapboxgl-ctrl-geolocate",this._container),n("span","mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",!1===t){e.w("Geolocation support is not available so the GeolocateControl will be disabled.");const t=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.setAttribute("aria-label",t),this._geolocateButton.firstElementChild&&this._geolocateButton.firstElementChild.setAttribute("title",t)}else{const e=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.setAttribute("aria-label",e),this._geolocateButton.firstElementChild&&this._geolocateButton.firstElementChild.setAttribute("title",e)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=n("div","mapboxgl-user-location"),this._dotElement.appendChild(n("div","mapboxgl-user-location-dot")),this._dotElement.appendChild(n("div","mapboxgl-user-location-heading")),this._userLocationDotMarker=new Os({element:this._dotElement,rotationAlignment:"map",pitchAlignment:"map"}),this._circleElement=n("div","mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Os({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",this.trigger.bind(this)),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",(t=>{t.geolocateSource||"ACTIVE_LOCK"!==this._watchState||t.originalEvent&&"resize"===t.originalEvent.type||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this.fire(new e.g("trackuserlocationend")))}))}}_onDeviceOrientation(e){this._userLocationDotMarker&&(e.webkitCompassHeading?this._heading=e.webkitCompassHeading:!0===e.absolute&&(this._heading=-1*e.alpha),this._updateMarkerRotationThrottled())}trigger(){if(!this._setup)return e.w("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new e.g("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":this._numberOfWatches--,this._noTimeout=!1,this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this.fire(new e.g("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new e.g("trackuserlocationstart"))}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"BACKGROUND":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");break;case"BACKGROUND_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error")}if("OFF"===this._watchState&&void 0!==this._geolocationWatchID)this._clearWatch();else if(void 0===this._geolocationWatchID){let e;this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),this._numberOfWatches++,this._numberOfWatches>1?(e={maximumAge:6e5,timeout:0},this._noTimeout=!0):(e=this.options.positionOptions,this._noTimeout=!1),this._geolocationWatchID=this.options.geolocation.watchPosition(this._onSuccess,this._onError,e),this.options.showUserHeading&&this._addDeviceOrientationListener()}}else this.options.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=window.setTimeout(this._finish,1e4);return!0}_addDeviceOrientationListener(){const e=()=>{"ondeviceorientationabsolute"in window?window.addEventListener("deviceorientationabsolute",this._onDeviceOrientation):window.addEventListener("deviceorientation",this._onDeviceOrientation)};"undefined"!=typeof DeviceMotionEvent&&"function"==typeof DeviceMotionEvent.requestPermission?DeviceOrientationEvent.requestPermission().then((t=>{"granted"===t&&e()})).catch(console.error):e()}_clearWatch(){this.options.geolocation.clearWatch(this._geolocationWatchID),window.removeEventListener("deviceorientation",this._onDeviceOrientation),window.removeEventListener("deviceorientationabsolute",this._onDeviceOrientation),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)}},AttributionControl:zs,ScaleControl:class{constructor(t={}){this.options=e.Q({},Ws,t),this._isNumberFormatSupported=(function(){try{return new Intl.NumberFormat("en",{style:"unit",unitDisplay:"short",unit:"meter"}),!0}catch(e){return!1}})(),e.br(["_update","_setScale","setUnit"],this)}getDefaultPosition(){return"bottom-left"}_update(){const e=this.options.maxWidth||100,t=this._map,i=t._containerHeight/2,r=t._containerWidth/2-e/2,n=t.unproject([r,i]),o=t.unproject([r+e,i]),s=n.distanceTo(o);if("imperial"===this.options.unit){const t=3.2808*s;t>5280?this._setScale(e,t/5280,"mile"):this._setScale(e,t,"foot")}else"nautical"===this.options.unit?this._setScale(e,s/1852,"nautical-mile"):s>=1e3?this._setScale(e,s/1e3,"kilometer"):this._setScale(e,s,"meter")}_setScale(e,t,i){this._map._requestDomTask((()=>{const r=(function(e){const t=Math.pow(10,`${Math.floor(e)}`.length-1);let i=e/t;return i=i>=10?10:i>=5?5:i>=3?3:i>=2?2:i>=1?1:(function(e){const t=Math.pow(10,Math.ceil(-Math.log(e)/Math.LN10));return Math.round(e*t)/t})(i),t*i})(t),n=r/t;this._container.innerHTML=this._isNumberFormatSupported&&"nautical-mile"!==i?new Intl.NumberFormat(this._language,{style:"unit",unitDisplay:"short",unit:i}).format(r):`${r} ${Hs[i]}`,this._container.style.width=e*n+"px"}))}onAdd(e){return this._map=e,this._language=e.getLanguage(),this._container=n("div","mapboxgl-ctrl mapboxgl-ctrl-scale",e.getContainer()),this._container.dir="auto",this._map.on("move",this._update),this._update(),this._container}onRemove(){this._container.remove(),this._map.off("move",this._update),this._map=void 0}_setLanguage(e){this._language=e,this._update()}setUnit(e){this.options.unit=e,this._update()}},FullscreenControl:class{constructor(t={}){this._fullscreen=!1,t&&t.container&&(t.container instanceof HTMLElement?this._container=t.container:e.w("Full screen control 'container' must be a DOM element.")),e.br(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in document?this._fullscreenchange="fullscreenchange":"onwebkitfullscreenchange"in document&&(this._fullscreenchange="webkitfullscreenchange")}onAdd(t){return this._map=t,this._container||(this._container=this._map.getContainer()),this._controlContainer=n("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",e.w("This device does not support fullscreen mode.")),this._controlContainer}onRemove(){this._controlContainer.remove(),this._map=null,document.removeEventListener(this._fullscreenchange,this._changeIcon)}_checkFullscreenSupport(){return!(!document.fullscreenEnabled&&!document.webkitFullscreenEnabled)}_setupUI(){const e=this._fullscreenButton=n("button","mapboxgl-ctrl-fullscreen",this._controlContainer);n("span","mapboxgl-ctrl-icon",e).setAttribute("aria-hidden","true"),e.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),document.addEventListener(this._fullscreenchange,this._changeIcon)}_updateTitle(){const e=this._getTitle();this._fullscreenButton.setAttribute("aria-label",e),this._fullscreenButton.firstElementChild&&this._fullscreenButton.firstElementChild.setAttribute("title",e)}_getTitle(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")}_isFullscreen(){return this._fullscreen}_changeIcon(){(document.fullscreenElement||document.webkitFullscreenElement)===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("mapboxgl-ctrl-shrink"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"),this._updateTitle())}_onClickFullscreen(){this._isFullscreen()?document.exitFullscreen?document.exitFullscreen():document.webkitCancelFullScreen&&document.webkitCancelFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.webkitRequestFullscreen&&this._container.webkitRequestFullscreen()}},Popup:class extends e.E{constructor(t){super(),this.options=e.Q(Object.create(Bs),t),e.br(["_update","_onClose","remove","_onMouseEvent"],this),this._classList=new Set(t&&t.className?t.className.trim().split(/\s+/):[])}addTo(t){return this._map&&this.remove(),this._map=t,this.options.closeOnClick&&t.on("preclick",this._onClose),this.options.closeOnMove&&t.on("move",this._onClose),t.on("remove",this.remove),this._update(),t._addPopup(this),this._focusFirstElement(),this._trackPointer?(t.on("mousemove",this._onMouseEvent),t.on("mouseup",this._onMouseEvent),t._canvasContainer.classList.add("mapboxgl-track-pointer")):t.on("move",this._update),this.fire(new e.g("open")),this}isOpen(){return!!this._map}remove(){this._content&&this._content.remove(),this._container&&(this._container.remove(),this._container=void 0);const t=this._map;return t&&(t.off("move",this._update),t.off("move",this._onClose),t.off("preclick",this._onClose),t.off("click",this._onClose),t.off("remove",this.remove),t.off("mousemove",this._onMouseEvent),t.off("mouseup",this._onMouseEvent),t.off("drag",this._onMouseEvent),t._canvasContainer&&t._canvasContainer.classList.remove("mapboxgl-track-pointer"),t._removePopup(this),this._map=void 0),this.fire(new e.g("close")),this}getLngLat(){return this._lngLat}setLngLat(t){this._lngLat=e.aJ.convert(t),this._pos=null,this._trackPointer=!1,this._update();const i=this._map;return i&&(i.on("move",this._update),i.off("mousemove",this._onMouseEvent),i._canvasContainer.classList.remove("mapboxgl-track-pointer")),this}trackPointer(){this._trackPointer=!0,this._pos=null,this._update();const e=this._map;return e&&(e.off("move",this._update),e.on("mousemove",this._onMouseEvent),e.on("drag",this._onMouseEvent),e._canvasContainer.classList.add("mapboxgl-track-pointer")),this}getElement(){return this._container}setText(e){return this.setDOMContent(document.createTextNode(e))}setHTML(e){const t=document.createDocumentFragment(),i=document.createElement("body");let r;for(i.innerHTML=e;r=i.firstChild,r;)t.appendChild(r);return this.setDOMContent(t)}getMaxWidth(){return this._container&&this._container.style.maxWidth}setMaxWidth(e){return this.options.maxWidth=e,this._update(),this}setDOMContent(e){let t=this._content;if(t)for(;t.hasChildNodes();)t.firstChild&&t.removeChild(t.firstChild);else t=this._content=n("div","mapboxgl-popup-content",this._container||void 0);if(t.appendChild(e),this.options.closeButton){const e=this._closeButton=n("button","mapboxgl-popup-close-button",t);e.type="button",e.setAttribute("aria-label","Close popup"),e.setAttribute("aria-hidden","true"),e.innerHTML="×",e.addEventListener("click",this._onClose)}return this._update(),this._focusFirstElement(),this}addClassName(e){return this._classList.add(e),this._updateClassList(),this}removeClassName(e){return this._classList.delete(e),this._updateClassList(),this}setOffset(e){return this.options.offset=e,this._update(),this}toggleClassName(e){let t;return this._classList.delete(e)?t=!1:(this._classList.add(e),t=!0),this._updateClassList(),t}_onMouseEvent(e){this._update(e.point)}_getAnchor(e){if(this.options.anchor)return this.options.anchor;const t=this._map,i=this._container,r=this._pos;if(!t||!i||!r)return"bottom";const n=i.offsetWidth,o=i.offsetHeight,s=r.xt.transform.width-n/2;if(r.y+et.transform.height-o){if(s)return"bottom-left";if(a)return"bottom-right"}return s?"left":a?"right":"bottom"}_updateClassList(){const e=this._container;if(!e)return;const t=[...this._classList];t.push("mapboxgl-popup"),this._anchor&&t.push(`mapboxgl-popup-anchor-${this._anchor}`),this._trackPointer&&t.push("mapboxgl-popup-track-pointer"),e.className=t.join(" ")}_update(t){const i=this._map,r=this._content;if(!i||!this._lngLat&&!this._trackPointer||!r)return;let o=this._container;if(o||(o=this._container=n("div","mapboxgl-popup",i.getContainer()),this._tip=n("div","mapboxgl-popup-tip",o),o.appendChild(r)),this.options.maxWidth&&o.style.maxWidth!==this.options.maxWidth&&(o.style.maxWidth=this.options.maxWidth),i.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=Ls(this._lngLat,this._pos,i.transform)),!this._trackPointer||t){const r=this._pos=this._trackPointer&&t instanceof e.P?t:i.project(this._lngLat),n=Ns(this.options.offset),o=this._anchor=this._getAnchor(n.y),s=Ns(this.options.offset,o),a=r.add(s).round();i._requestDomTask((()=>{this._container&&o&&(this._container.style.transform=`${ks[o]} translate(${a.x}px,${a.y}px)`)}))}if(!this._marker&&i._showingGlobe()){const t=e.dc(i.transform,this._lngLat)?0:1;this._setOpacity(t)}this._updateClassList()}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;const e=this._container.querySelector(Fs);e&&e.focus()}_onClose(){this.remove()}_setOpacity(e){this._container&&(this._container.style.opacity=`${e}`),this._content&&(this._content.style.pointerEvents=e?"auto":"none")}},Marker:Os,Style:zo,LngLat:e.aJ,LngLatBounds:e.aj,Point:e.P,MercatorCoordinate:e._,FreeCameraOptions:Zt,Evented:e.E,config:e.db,prewarm:e.dA,clearPrewarmedResources:e.dB,get accessToken(){return e.db.ACCESS_TOKEN},set accessToken(t){e.db.ACCESS_TOKEN=t},get baseApiUrl(){return e.db.API_URL},set baseApiUrl(t){e.db.API_URL=t},get workerCount(){return e.dC.workerCount},set workerCount(t){e.dC.workerCount=t},get maxParallelImageRequests(){return e.db.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(t){e.db.MAX_PARALLEL_IMAGE_REQUESTS=t},clearStorage(t){e.dD(t)},get workerUrl(){return e.dE.workerUrl},set workerUrl(t){e.dE.workerUrl=t},get workerClass(){return e.dE.workerClass},set workerClass(t){e.dE.workerClass=t},get workerParams(){return e.dE.workerParams},set workerParams(t){e.dE.workerParams=t},get dracoUrl(){return e.dF()},set dracoUrl(t){e.dG(t)},get meshoptUrl(){return e.dH()},set meshoptUrl(t){e.dI(t)},setNow:e.e.setNow,restoreNow:e.e.restoreNow};return Xs})),i}))}),84,[28]); -__d((function(g,r,i,a,m,e,d){var o=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.Camera=void 0;var t=r(d[1]),n=o(r(d[2])),s=r(d[3]);function c(o){return void 0===o?void 0:void 0===o.length?o:0===o.length?void 0:o.length<2?o[0]:o.length<4?{left:o[0],right:o[0],top:o[1],bottom:o[1]}:{top:o[0],right:o[1],bottom:o[2],left:o[3]}}class p extends t.Component{static contextType=n.default;static UserTrackingModes=[];componentDidMount(){const{map:o}=this.context;o&&(void 0!==this.props.minZoomLevel&&o.setMinZoom(this.props.minZoomLevel),void 0!==this.props.maxZoomLevel&&o.setMaxZoom(this.props.maxZoomLevel),void 0!==this.props.zoomLevel&&o.setZoom(this.props.zoomLevel),void 0!==this.props.centerCoordinate&&o.flyTo({center:this.props.centerCoordinate.slice(0,2),duration:0}))}fitBounds(o,t,n=0,s=0){const{map:p}=this.context;p&&p.fitBounds([o.slice(0,2),t.slice(0,2)],{padding:c(n),duration:s})}flyTo(o,t=2e3){const{map:n}=this.context;n&&n.flyTo({center:o.slice(0,2),duration:t})}moveTo(o,t=0){const{map:n}=this.context;n&&n.easeTo({center:o.slice(0,2),duration:t})}zoomTo(o,t=2e3){const{map:n}=this.context;n&&n.flyTo({zoom:o,duration:t})}setCamera(o){const{map:t}=this.context;if(!t)return;const{centerCoordinate:n,bounds:s,zoomLevel:p,heading:l,pitch:h,padding:u,animationDuration:f=2e3}=o;let v={center:n?.slice(0,2),zoom:p??t.getZoom(),bearing:l??t.getBearing(),pitch:h??t.getPitch()};if(u?.paddingTop&&u?.paddingRight&&u?.paddingBottom&&u?.paddingLeft&&(v.padding=c([u.paddingTop,u.paddingRight,u.paddingBottom,u.paddingLeft])),s?.ne&&s?.sw){const o=t.cameraForBounds([s.ne,s.sw],v);v=Object.assign({},v,o)}switch(o.animationMode){default:case'easeTo':case'linearTo':t.easeTo(Object.assign({},v,{duration:f}));break;case'flyTo':t.flyTo(Object.assign({},v,{duration:f}));break;case'moveTo':case'none':t.jumpTo(v)}}render(){return(0,s.jsx)(s.Fragment,{})}}e.Camera=p;e.default=p}),85,[1,14,86,87]); -__d((function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;const o=t(r(d[1])).default.createContext({});e.default=o}),86,[1,14]); -__d((function(g,r,i,a,m,e,d){'use strict';m.exports=r(d[0])}),87,[88]); -__d((function(_g,r,i,_a,_m,_e,_d){ +'use strict';function n(n,e){var t=n.length;n.push(e);n:for(;0>>1,l=n[r];if(!(0>>1;ra(s,t))ca(f,s)?(n[r]=f,n[c]=t,r=c):(n[r]=s,n[o]=t,r=o);else{if(!(ca(f,t)))break n;n[r]=f,n[c]=t,r=c}}}return e}function a(n,e){var t=n.sortIndex-e.sortIndex;return 0!==t?t:n.id-e.id}if("object"==typeof performance&&"function"==typeof performance.now){var r=performance;_e.unstable_now=function(){return r.now()}}else{var l=Date,u=l.now();_e.unstable_now=function(){return l.now()-u}}var o=[],s=[],c=1,f=null,b=3,d=!1,v=!1,p=!1,y="function"==typeof setTimeout?setTimeout:null,m="function"==typeof clearTimeout?clearTimeout:null,_="undefined"!=typeof setImmediate?setImmediate:null;function g(a){for(var r=e(s);null!==r;){if(null===r.callback)t(s);else{if(!(r.startTime<=a))break;t(s),r.sortIndex=r.expirationTime,n(o,r)}r=e(s)}}function h(n){if(p=!1,g(n),!v)if(null!==e(o))v=!0,E(k);else{var t=e(s);null!==t&&N(h,t.startTime-n)}}function k(n,a){v=!1,p&&(p=!1,m(T),T=-1),d=!0;var r=b;try{for(g(a),f=e(o);null!==f&&(!(f.expirationTime>a)||n&&!L());){var l=f.callback;if("function"==typeof l){f.callback=null,b=f.priorityLevel;var u=l(f.expirationTime<=a);a=_e.unstable_now(),"function"==typeof u?f.callback=u:f===e(o)&&t(o),g(a)}else t(o);f=e(o)}if(null!==f)var c=!0;else{var y=e(s);null!==y&&N(h,y.startTime-a),c=!1}return c}finally{f=null,b=r,d=!1}}"undefined"!=typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);var w,x=!1,I=null,T=-1,P=5,C=-1;function L(){return!(_e.unstable_now()-Cn||125l?(t.sortIndex=r,n(s,t),null===e(o)&&t===e(s)&&(p?(m(T),T=-1):p=!0,N(h,r-l))):(t.sortIndex=u,n(o,t),v||d||(v=!0,E(k))),t},_e.unstable_shouldYield=L,_e.unstable_wrapCallback=function(n){var e=b;return function(){var t=b;b=e;try{return n.apply(this,arguments)}finally{b=t}}}}),91,[]); +__d((function(g,r,_i,_a,m,e,d){ /** * @license React - * react-jsx-runtime.production.min.js + * scheduler.development.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ -'use strict';var e=r(_d[0]),o=Symbol.for("react.element"),t=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,_=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,f={key:!0,ref:!0,__self:!0,__source:!0};function a(e,t,a){var l,s={},u=null,y=null;for(l in void 0!==a&&(u=""+a),void 0!==t.key&&(u=""+t.key),void 0!==t.ref&&(y=t.ref),t)n.call(t,l)&&!f.hasOwnProperty(l)&&(s[l]=t[l]);if(e&&e.defaultProps)for(l in t=e.defaultProps)void 0===s[l]&&(s[l]=t[l]);return{$$typeof:o,type:e,key:u,ref:y,props:s,_owner:_.current}}_e.Fragment=t,_e.jsx=a,_e.jsxs=a}),88,[14]); -__d((function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=t(r(d[1])),s=t(r(d[2])),o=t(r(d[3])),l=r(d[4]);class p extends n.default.Component{state={map:null};mapContainer=null;map=null;componentDidMount(){const{styleURL:t}=this.props;if(!this.mapContainer)return void console.error('MapView - mapContainer should is null');const n=new s.default.Map({container:this.mapContainer,style:t||'mapbox://styles/mapbox/streets-v11'});this.map=n,this.setState({map:n})}render(){const{children:t}=this.props,{map:n}=this.state;return(0,l.jsx)("div",{style:{width:'100%',height:'100%'},ref:t=>this.mapContainer=t,children:n&&(0,l.jsx)("div",{style:{position:'absolute'},children:(0,l.jsx)(o.default.Provider,{value:{map:n},children:t})})})}}e.default=p}),89,[1,14,84,86,87]); -__d((function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=r(d[1]),o=t(r(d[2]));function l(t,l){const{map:c}=(0,n.useContext)(o.default),u=(0,n.useMemo)((()=>{const o=new(r(d[3]).Marker)({element:(0,n.isValidElement)(t.children)?document.createElement('div'):void 0});o.setLngLat(t.coordinate);const{style:l}=o.getElement();return l.position='absolute',l.top='0',l.left='0',o}),[]);(0,n.useEffect)((()=>{if(void 0!==c)return u.addTo(c),()=>{u.remove()}}),[c]),(0,n.useImperativeHandle)(l,(()=>u),[]);const s=u.getLngLat();return s.lng===t.coordinate[0]&&s.lat===t.coordinate[1]||u.setLngLat([t.coordinate[0],t.coordinate[1]]),(0,r(d[4]).createPortal)(t.children,u.getElement())}e.default=(0,n.memo)((0,n.forwardRef)(l))}),90,[1,14,86,84,12]); -__d((function(g,r,i,a,m,e,d){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;class t{static instance=null;level='info';startedCount=0;static sharedInstance(){return null===this.instance&&(this.instance=new t),this.instance}constructor(){this.logCallback=null}static setLogCallback(t){this.sharedInstance().setLogCallback(t)}setLogCallback(t){this.logCallback=t}static setLogLevel(t){this.sharedInstance().level=t}start(){}stop(){}subscribe(){}unsubscribe(){}effectiveLevel(t){const{level:s,message:n,tag:l}=t;return'warning'===s&&'Mbgl-HttpRequest'===l&&n.startsWith('Request failed due to a permanent error: Canceled')?'info':s}onLog(t){if(!this.logCallback||!this.logCallback(t)){const{message:s}=t,n=this.effectiveLevel(t);'error'===n?console.error('Mapbox error',s,t):'warning'===n?console.warn('Mapbox warning',s,t):console.log(`Mapbox [${n}]`,s,t)}}}t.sharedInstance().start();e.default=t}),91,[]); -__d((function(g,_r,_i,_a,m,_e,d){var e=_r(d[0]);Object.defineProperty(_e,"__esModule",{value:!0}),_e.default=void 0;var o=e(_r(d[1])),t=e(_r(d[2])),n=f(_r(d[3])),r=e(_r(d[4])),l=f(_r(d[5])),a=e(_r(d[6])),s=e(_r(d[7])),p=e(_r(d[8])),u=e(_r(d[9])),i=e(_r(d[10])),S=e(_r(d[11])),c=e(_r(d[12]));function R(e){if("function"!=typeof WeakMap)return null;var o=new WeakMap,t=new WeakMap;return(R=function(e){return e?t:o})(e)}function f(e,o){if(!o&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=R(o);if(t&&t.has(e))return t.get(e);var n={__proto__:null},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in e)if("default"!==l&&{}.hasOwnProperty.call(e,l)){var a=r?Object.getOwnPropertyDescriptor(e,l):null;a&&(a.get||a.set)?Object.defineProperty(n,l,a):n[l]=e[l]}return n.default=e,t&&t.set(e,n),n}var h=["hrefAttrs","numberOfLines","onClick","onLayout","onPress","onMoveShouldSetResponder","onMoveShouldSetResponderCapture","onResponderEnd","onResponderGrant","onResponderMove","onResponderReject","onResponderRelease","onResponderStart","onResponderTerminate","onResponderTerminationRequest","onScrollShouldSetResponder","onScrollShouldSetResponderCapture","onSelectionChangeShouldSetResponder","onSelectionChangeShouldSetResponderCapture","onStartShouldSetResponder","onStartShouldSetResponderCapture","selectable"],v=Object.assign({},l.defaultProps,l.accessibilityProps,l.clickProps,l.focusProps,l.keyboardProps,l.mouseProps,l.touchProps,l.styleProps,{href:!0,lang:!0,pointerEvents:!0}),b=e=>(0,a.default)(e,v),w=n.forwardRef(((e,o)=>{var l=e.hrefAttrs,a=e.numberOfLines,S=e.onClick,R=e.onLayout,f=e.onPress,v=e.onMoveShouldSetResponder,w=e.onMoveShouldSetResponderCapture,C=e.onResponderEnd,y=e.onResponderGrant,P=e.onResponderMove,O=e.onResponderReject,k=e.onResponderRelease,M=e.onResponderStart,_=e.onResponderTerminate,L=e.onResponderTerminationRequest,j=e.onScrollShouldSetResponder,W=e.onScrollShouldSetResponderCapture,A=e.onSelectionChangeShouldSetResponder,T=e.onSelectionChangeShouldSetResponderCapture,D=e.onStartShouldSetResponder,E=e.onStartShouldSetResponderCapture,$=e.selectable,q=(0,t.default)(e,h);null!=$&&(0,_r(d[13]).warnOnce)('selectable','selectable prop is deprecated. Use styles.userSelect.');var G=n.useContext(c.default),H=n.useRef(null),z=(0,_r(d[14]).useLocaleContext)().direction;(0,s.default)(H,R),(0,i.default)(H,{onMoveShouldSetResponder:v,onMoveShouldSetResponderCapture:w,onResponderEnd:C,onResponderGrant:y,onResponderMove:P,onResponderReject:O,onResponderRelease:k,onResponderStart:M,onResponderTerminate:_,onResponderTerminationRequest:L,onScrollShouldSetResponder:j,onScrollShouldSetResponderCapture:W,onSelectionChangeShouldSetResponder:A,onSelectionChangeShouldSetResponderCapture:T,onStartShouldSetResponder:D,onStartShouldSetResponderCapture:E});var B=n.useCallback((e=>{null!=S?S(e):null!=f&&(e.stopPropagation(),f(e))}),[S,f]),N=G?'span':'div',U=null!=e.lang?(0,_r(d[14]).getLocaleDirection)(e.lang):null,F=e.dir||U,I=F||z,J=b(q);if(J.dir=F,G||(J.dir=null!=F?F:'auto'),(S||f)&&(J.onClick=B),J.style=[null!=a&&a>1&&{WebkitLineClamp:a},!0===G?x.textHasAncestor$raw:x.text$raw,1===a&&x.textOneLine,null!=a&&a>1&&x.textMultiLine,e.style,!0===$&&x.selectable,!1===$&&x.notSelectable,f&&x.pressable],null!=e.href&&(N='a',null!=l)){var K=l.download,Q=l.rel,V=l.target;null!=K&&(J.download=K),null!=Q&&(J.rel=Q),'string'==typeof V&&(J.target='_'!==V.charAt(0)?'_'+V:V)}var X=(0,u.default)(J),Y=(0,p.default)(H,X,o);J.ref=Y;var Z=(0,r.default)(N,J,{writingDirection:I});return G?Z:n.createElement(c.default.Provider,{value:!0},Z)}));w.displayName='Text';var C={backgroundColor:'transparent',border:'0 solid black',boxSizing:'border-box',color:'black',display:'inline',font:'14px System',listStyle:'none',margin:0,padding:0,position:'relative',textAlign:'start',textDecoration:'none',whiteSpace:'pre-wrap',wordWrap:'break-word'},x=S.default.create({text$raw:C,textHasAncestor$raw:(0,o.default)((0,o.default)({},C),{},{color:'inherit',font:'inherit',textAlign:'inherit',whiteSpace:'inherit'}),textOneLine:{maxWidth:'100%',overflow:'hidden',textOverflow:'ellipsis',whiteSpace:'nowrap',wordWrap:'normal'},textMultiLine:{display:'-webkit-box',maxWidth:'100%',overflow:'hidden',textOverflow:'ellipsis',WebkitBoxOrient:'vertical'},notSelectable:{userSelect:'none'},selectable:{userSelect:'text'},pressable:{cursor:'pointer'}});_e.default=w}),92,[1,5,28,14,93,101,102,103,110,112,114,27,121,39,99]); -__d((function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var l=t(r(d[1])),o=t(r(d[2])),n=t(r(d[3]));e.default=(t,c,u)=>{var f;t&&t.constructor===String&&(f=l.default.propsToAccessibilityComponent(c));var v=f||t,s=(0,o.default)(v,c,u),p=n.default.createElement(v,s);return s.dir?n.default.createElement(r(d[4]).LocaleProvider,{children:p,direction:s.dir,locale:s.lang}):p}}),93,[1,94,98,14,99]); -__d((function(g,r,i,a,m,e,d){var o=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var l=o(r(d[1])),t=o(r(d[2])),u=o(r(d[3])),f={isDisabled:l.default,propsToAccessibilityComponent:t.default,propsToAriaRole:u.default};e.default=f}),94,[1,95,96,97]); -__d((function(g,r,i,a,m,e,d){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;e.default=t=>t.disabled||Array.isArray(t.accessibilityStates)&&t.accessibilityStates.indexOf('disabled')>-1}),95,[]); -__d((function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=t(r(d[1])),o={article:'article',banner:'header',blockquote:'blockquote',button:'button',code:'code',complementary:'aside',contentinfo:'footer',deletion:'del',emphasis:'em',figure:'figure',insertion:'ins',form:'form',list:'ul',listitem:'li',main:'main',navigation:'nav',paragraph:'p',region:'section',strong:'strong'},l={};e.default=function(t){if(void 0===t&&(t=l),'label'===(t.role||t.accessibilityRole))return'label';var u=(0,n.default)(t);if(u){if('heading'===u){var c=t.accessibilityLevel||t['aria-level'];return null!=c?"h"+c:'h1'}return o[u]}}}),96,[1,97]); -__d((function(g,r,i,a,m,e,d){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var l={adjustable:'slider',button:'button',header:'heading',image:'img',imagebutton:null,keyboardkey:null,label:null,link:'link',none:'presentation',search:'search',summary:'region',text:null};e.default=n=>{var t=n.accessibilityRole,u=n.role||t;if(u){var o=l[u];if(null!==o)return o||u}}}),97,[]); -__d((function(g,r,i,a,m,e,d){var l=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var s=l(r(d[1])),c=l(r(d[2])),t=l(r(d[3])),n=l(r(d[4])),u=["aria-activedescendant","accessibilityActiveDescendant","aria-atomic","accessibilityAtomic","aria-autocomplete","accessibilityAutoComplete","aria-busy","accessibilityBusy","aria-checked","accessibilityChecked","aria-colcount","accessibilityColumnCount","aria-colindex","accessibilityColumnIndex","aria-colspan","accessibilityColumnSpan","aria-controls","accessibilityControls","aria-current","accessibilityCurrent","aria-describedby","accessibilityDescribedBy","aria-details","accessibilityDetails","aria-disabled","accessibilityDisabled","aria-errormessage","accessibilityErrorMessage","aria-expanded","accessibilityExpanded","aria-flowto","accessibilityFlowTo","aria-haspopup","accessibilityHasPopup","aria-hidden","accessibilityHidden","aria-invalid","accessibilityInvalid","aria-keyshortcuts","accessibilityKeyShortcuts","aria-label","accessibilityLabel","aria-labelledby","accessibilityLabelledBy","aria-level","accessibilityLevel","aria-live","accessibilityLiveRegion","aria-modal","accessibilityModal","aria-multiline","accessibilityMultiline","aria-multiselectable","accessibilityMultiSelectable","aria-orientation","accessibilityOrientation","aria-owns","accessibilityOwns","aria-placeholder","accessibilityPlaceholder","aria-posinset","accessibilityPosInSet","aria-pressed","accessibilityPressed","aria-readonly","accessibilityReadOnly","aria-required","accessibilityRequired","role","accessibilityRole","aria-roledescription","accessibilityRoleDescription","aria-rowcount","accessibilityRowCount","aria-rowindex","accessibilityRowIndex","aria-rowspan","accessibilityRowSpan","aria-selected","accessibilitySelected","aria-setsize","accessibilitySetSize","aria-sort","accessibilitySort","aria-valuemax","accessibilityValueMax","aria-valuemin","accessibilityValueMin","aria-valuenow","accessibilityValueNow","aria-valuetext","accessibilityValueText","dataSet","focusable","id","nativeID","pointerEvents","style","tabIndex","testID"],o={},b=Object.prototype.hasOwnProperty,y=Array.isArray,p=/[A-Z]/g;function v(l){return'-'+l.toLowerCase()}function w(l){return y(l)?l.join(' '):l}var O=n.default.create({auto:{pointerEvents:'auto'},'box-none':{pointerEvents:'box-none'},'box-only':{pointerEvents:'box-only'},none:{pointerEvents:'none'}});e.default=(l,y,x)=>{y||(y=o);var U=y,S=U['aria-activedescendant'],C=U.accessibilityActiveDescendant,h=U['aria-atomic'],R=U.accessibilityAtomic,I=U['aria-autocomplete'],D=U.accessibilityAutoComplete,f=U['aria-busy'],M=U.accessibilityBusy,P=U['aria-checked'],E=U.accessibilityChecked,L=U['aria-colcount'],A=U.accessibilityColumnCount,V=U['aria-colindex'],k=U.accessibilityColumnIndex,B=U['aria-colspan'],q=U.accessibilityColumnSpan,T=U['aria-controls'],z=U.accessibilityControls,H=U['aria-current'],N=U.accessibilityCurrent,F=U['aria-describedby'],K=U.accessibilityDescribedBy,_=U['aria-details'],j=U.accessibilityDetails,Z=U['aria-disabled'],G=U.accessibilityDisabled,J=U['aria-errormessage'],Q=U.accessibilityErrorMessage,W=U['aria-expanded'],X=U.accessibilityExpanded,Y=U['aria-flowto'],$=U.accessibilityFlowTo,ii=U['aria-haspopup'],ei=U.accessibilityHasPopup,ai=U['aria-hidden'],li=U.accessibilityHidden,si=U['aria-invalid'],ci=U.accessibilityInvalid,ti=U['aria-keyshortcuts'],ri=U.accessibilityKeyShortcuts,ni=U['aria-label'],ui=U.accessibilityLabel,di=U['aria-labelledby'],oi=U.accessibilityLabelledBy,bi=U['aria-level'],yi=U.accessibilityLevel,pi=U['aria-live'],vi=U.accessibilityLiveRegion,wi=U['aria-modal'],Oi=U.accessibilityModal,xi=U['aria-multiline'],mi=U.accessibilityMultiline,Ui=U['aria-multiselectable'],Si=U.accessibilityMultiSelectable,Ci=U['aria-orientation'],hi=U.accessibilityOrientation,Ri=U['aria-owns'],Ii=U.accessibilityOwns,Di=U['aria-placeholder'],fi=U.accessibilityPlaceholder,Mi=U['aria-posinset'],Pi=U.accessibilityPosInSet,Ei=U['aria-pressed'],Li=U.accessibilityPressed,Ai=U['aria-readonly'],Vi=U.accessibilityReadOnly,gi=U['aria-required'],ki=U.accessibilityRequired,Bi=(U.role,U.accessibilityRole),qi=U['aria-roledescription'],Ti=U.accessibilityRoleDescription,zi=U['aria-rowcount'],Hi=U.accessibilityRowCount,Ni=U['aria-rowindex'],Fi=U.accessibilityRowIndex,Ki=U['aria-rowspan'],_i=U.accessibilityRowSpan,ji=U['aria-selected'],Zi=U.accessibilitySelected,Gi=U['aria-setsize'],Ji=U.accessibilitySetSize,Qi=U['aria-sort'],Wi=U.accessibilitySort,Xi=U['aria-valuemax'],Yi=U.accessibilityValueMax,$i=U['aria-valuemin'],ie=U.accessibilityValueMin,ee=U['aria-valuenow'],ae=U.accessibilityValueNow,le=U['aria-valuetext'],se=U.accessibilityValueText,ce=U.dataSet,te=U.focusable,re=U.id,ne=U.nativeID,ue=U.pointerEvents,de=U.style,oe=U.tabIndex,be=U.testID,ye=(0,c.default)(U,u);null!=G&&(0,r(d[5]).warnOnce)('accessibilityDisabled',"accessibilityDisabled is deprecated.");var pe=Z||G,ve=t.default.propsToAriaRole(y);null!=C&&(0,r(d[5]).warnOnce)('accessibilityActiveDescendant',"accessibilityActiveDescendant is deprecated. Use aria-activedescendant.");var we=null!=S?S:C;null!=we&&(ye['aria-activedescendant']=we),null!=R&&(0,r(d[5]).warnOnce)('accessibilityAtomic',"accessibilityAtomic is deprecated. Use aria-atomic.");var Oe=null!=h?S:R;null!=Oe&&(ye['aria-atomic']=Oe),null!=D&&(0,r(d[5]).warnOnce)('accessibilityAutoComplete',"accessibilityAutoComplete is deprecated. Use aria-autocomplete.");var xe=null!=I?I:D;null!=xe&&(ye['aria-autocomplete']=xe),null!=M&&(0,r(d[5]).warnOnce)('accessibilityBusy',"accessibilityBusy is deprecated. Use aria-busy.");var me=null!=f?f:M;null!=me&&(ye['aria-busy']=me),null!=E&&(0,r(d[5]).warnOnce)('accessibilityChecked',"accessibilityChecked is deprecated. Use aria-checked.");var Ue=null!=P?P:E;null!=Ue&&(ye['aria-checked']=Ue),null!=A&&(0,r(d[5]).warnOnce)('accessibilityColumnCount',"accessibilityColumnCount is deprecated. Use aria-colcount.");var Se=null!=L?L:A;null!=Se&&(ye['aria-colcount']=Se),null!=k&&(0,r(d[5]).warnOnce)('accessibilityColumnIndex',"accessibilityColumnIndex is deprecated. Use aria-colindex.");var Ce=null!=V?V:k;null!=Ce&&(ye['aria-colindex']=Ce),null!=q&&(0,r(d[5]).warnOnce)('accessibilityColumnSpan',"accessibilityColumnSpan is deprecated. Use aria-colspan.");var he=null!=B?B:q;null!=he&&(ye['aria-colspan']=he),null!=z&&(0,r(d[5]).warnOnce)('accessibilityControls',"accessibilityControls is deprecated. Use aria-controls.");var Re=null!=T?T:z;null!=Re&&(ye['aria-controls']=w(Re)),null!=N&&(0,r(d[5]).warnOnce)('accessibilityCurrent',"accessibilityCurrent is deprecated. Use aria-current.");var Ie=null!=H?H:N;null!=Ie&&(ye['aria-current']=Ie),null!=K&&(0,r(d[5]).warnOnce)('accessibilityDescribedBy',"accessibilityDescribedBy is deprecated. Use aria-describedby.");var De=null!=F?F:K;null!=De&&(ye['aria-describedby']=w(De)),null!=j&&(0,r(d[5]).warnOnce)('accessibilityDetails',"accessibilityDetails is deprecated. Use aria-details.");var fe=null!=_?_:j;null!=fe&&(ye['aria-details']=fe),!0===pe&&(ye['aria-disabled']=!0,'button'!==l&&'form'!==l&&'input'!==l&&'select'!==l&&'textarea'!==l||(ye.disabled=!0)),null!=Q&&(0,r(d[5]).warnOnce)('accessibilityErrorMessage',"accessibilityErrorMessage is deprecated. Use aria-errormessage.");var Me=null!=J?J:Q;null!=Me&&(ye['aria-errormessage']=Me),null!=X&&(0,r(d[5]).warnOnce)('accessibilityExpanded',"accessibilityExpanded is deprecated. Use aria-expanded.");var Pe=null!=W?W:X;null!=Pe&&(ye['aria-expanded']=Pe),null!=$&&(0,r(d[5]).warnOnce)('accessibilityFlowTo',"accessibilityFlowTo is deprecated. Use aria-flowto.");var Ee=null!=Y?Y:$;null!=Ee&&(ye['aria-flowto']=w(Ee)),null!=ei&&(0,r(d[5]).warnOnce)('accessibilityHasPopup',"accessibilityHasPopup is deprecated. Use aria-haspopup.");var Le=null!=ii?ii:ei;null!=Le&&(ye['aria-haspopup']=Le),null!=li&&(0,r(d[5]).warnOnce)('accessibilityHidden',"accessibilityHidden is deprecated. Use aria-hidden.");var Ae=null!=ai?ai:li;!0===Ae&&(ye['aria-hidden']=Ae),null!=ci&&(0,r(d[5]).warnOnce)('accessibilityInvalid',"accessibilityInvalid is deprecated. Use aria-invalid.");var Ve=null!=si?si:ci;null!=Ve&&(ye['aria-invalid']=Ve),null!=ri&&(0,r(d[5]).warnOnce)('accessibilityKeyShortcuts',"accessibilityKeyShortcuts is deprecated. Use aria-keyshortcuts.");var ge=null!=ti?ti:ri;null!=ge&&(ye['aria-keyshortcuts']=w(ge)),null!=ui&&(0,r(d[5]).warnOnce)('accessibilityLabel',"accessibilityLabel is deprecated. Use aria-label.");var ke=null!=ni?ni:ui;null!=ke&&(ye['aria-label']=ke),null!=oi&&(0,r(d[5]).warnOnce)('accessibilityLabelledBy',"accessibilityLabelledBy is deprecated. Use aria-labelledby.");var Be=null!=di?di:oi;null!=Be&&(ye['aria-labelledby']=w(Be)),null!=yi&&(0,r(d[5]).warnOnce)('accessibilityLevel',"accessibilityLevel is deprecated. Use aria-level.");var qe=null!=bi?bi:yi;null!=qe&&(ye['aria-level']=qe),null!=vi&&(0,r(d[5]).warnOnce)('accessibilityLiveRegion',"accessibilityLiveRegion is deprecated. Use aria-live.");var Te=null!=pi?pi:vi;null!=Te&&(ye['aria-live']='none'===Te?'off':Te),null!=Oi&&(0,r(d[5]).warnOnce)('accessibilityModal',"accessibilityModal is deprecated. Use aria-modal.");var ze=null!=wi?wi:Oi;null!=ze&&(ye['aria-modal']=ze),null!=mi&&(0,r(d[5]).warnOnce)('accessibilityMultiline',"accessibilityMultiline is deprecated. Use aria-multiline.");var He=null!=xi?xi:mi;null!=He&&(ye['aria-multiline']=He),null!=Si&&(0,r(d[5]).warnOnce)('accessibilityMultiSelectable',"accessibilityMultiSelectable is deprecated. Use aria-multiselectable.");var Ne=null!=Ui?Ui:Si;null!=Ne&&(ye['aria-multiselectable']=Ne),null!=hi&&(0,r(d[5]).warnOnce)('accessibilityOrientation',"accessibilityOrientation is deprecated. Use aria-orientation.");var Fe=null!=Ci?Ci:hi;null!=Fe&&(ye['aria-orientation']=Fe),null!=Ii&&(0,r(d[5]).warnOnce)('accessibilityOwns',"accessibilityOwns is deprecated. Use aria-owns.");var Ke=null!=Ri?Ri:Ii;null!=Ke&&(ye['aria-owns']=w(Ke)),null!=fi&&(0,r(d[5]).warnOnce)('accessibilityPlaceholder',"accessibilityPlaceholder is deprecated. Use aria-placeholder.");var _e=null!=Di?Di:fi;null!=_e&&(ye['aria-placeholder']=_e),null!=Pi&&(0,r(d[5]).warnOnce)('accessibilityPosInSet',"accessibilityPosInSet is deprecated. Use aria-posinset.");var je=null!=Mi?Mi:Pi;null!=je&&(ye['aria-posinset']=je),null!=Li&&(0,r(d[5]).warnOnce)('accessibilityPressed',"accessibilityPressed is deprecated. Use aria-pressed.");var Ze=null!=Ei?Ei:Li;null!=Ze&&(ye['aria-pressed']=Ze),null!=Vi&&(0,r(d[5]).warnOnce)('accessibilityReadOnly',"accessibilityReadOnly is deprecated. Use aria-readonly.");var Ge=null!=Ai?Ai:Vi;null!=Ge&&(ye['aria-readonly']=Ge,'input'!==l&&'select'!==l&&'textarea'!==l||(ye.readOnly=!0)),null!=ki&&(0,r(d[5]).warnOnce)('accessibilityRequired',"accessibilityRequired is deprecated. Use aria-required.");var Je=null!=gi?gi:ki;null!=Je&&(ye['aria-required']=Je,'input'!==l&&'select'!==l&&'textarea'!==l||(ye.required=ki)),null!=Bi&&(0,r(d[5]).warnOnce)('accessibilityRole',"accessibilityRole is deprecated. Use role."),null!=ve&&(ye.role='none'===ve?'presentation':ve),null!=Ti&&(0,r(d[5]).warnOnce)('accessibilityRoleDescription',"accessibilityRoleDescription is deprecated. Use aria-roledescription.");var Qe=null!=qi?qi:Ti;null!=Qe&&(ye['aria-roledescription']=Qe),null!=Hi&&(0,r(d[5]).warnOnce)('accessibilityRowCount',"accessibilityRowCount is deprecated. Use aria-rowcount.");var We=null!=zi?zi:Hi;null!=We&&(ye['aria-rowcount']=We),null!=Fi&&(0,r(d[5]).warnOnce)('accessibilityRowIndex',"accessibilityRowIndex is deprecated. Use aria-rowindex.");var Xe=null!=Ni?Ni:Fi;null!=Xe&&(ye['aria-rowindex']=Xe),null!=_i&&(0,r(d[5]).warnOnce)('accessibilityRowSpan',"accessibilityRowSpan is deprecated. Use aria-rowspan.");var Ye=null!=Ki?Ki:_i;null!=Ye&&(ye['aria-rowspan']=Ye),null!=Zi&&(0,r(d[5]).warnOnce)('accessibilitySelected',"accessibilitySelected is deprecated. Use aria-selected.");var $e=null!=ji?ji:Zi;null!=$e&&(ye['aria-selected']=$e),null!=Ji&&(0,r(d[5]).warnOnce)('accessibilitySetSize',"accessibilitySetSize is deprecated. Use aria-setsize.");var ia=null!=Gi?Gi:Ji;null!=ia&&(ye['aria-setsize']=ia),null!=Wi&&(0,r(d[5]).warnOnce)('accessibilitySort',"accessibilitySort is deprecated. Use aria-sort.");var ea=null!=Qi?Qi:Wi;null!=ea&&(ye['aria-sort']=ea),null!=Yi&&(0,r(d[5]).warnOnce)('accessibilityValueMax',"accessibilityValueMax is deprecated. Use aria-valuemax.");var aa=null!=Xi?Xi:Yi;null!=aa&&(ye['aria-valuemax']=aa),null!=ie&&(0,r(d[5]).warnOnce)('accessibilityValueMin',"accessibilityValueMin is deprecated. Use aria-valuemin.");var la=null!=$i?$i:ie;null!=la&&(ye['aria-valuemin']=la),null!=ae&&(0,r(d[5]).warnOnce)('accessibilityValueNow',"accessibilityValueNow is deprecated. Use aria-valuenow.");var sa=null!=ee?ee:ae;null!=sa&&(ye['aria-valuenow']=sa),null!=se&&(0,r(d[5]).warnOnce)('accessibilityValueText',"accessibilityValueText is deprecated. Use aria-valuetext.");var ca=null!=le?le:se;if(null!=ca&&(ye['aria-valuetext']=ca),null!=ce)for(var ta in ce)if(b.call(ce,ta)){var ra=ta.replace(p,v),na=ce[ta];null!=na&&(ye["data-"+ra]=na)}0===oe||'0'===oe||-1===oe||'-1'===oe?ye.tabIndex=oe:(null!=te&&(0,r(d[5]).warnOnce)('focusable',"focusable is deprecated."),!1===te&&(ye.tabIndex='-1'),'a'===l||'button'===l||'input'===l||'select'===l||'textarea'===l?!1!==te&&!0!==G||(ye.tabIndex='-1'):'button'===ve||'checkbox'===ve||'link'===ve||'radio'===ve||'textbox'===ve||'switch'===ve?!1!==te&&(ye.tabIndex='0'):!0===te&&(ye.tabIndex='0')),null!=ue&&(0,r(d[5]).warnOnce)('pointerEvents',"props.pointerEvents is deprecated. Use style.pointerEvents");var ua=(0,n.default)([de,ue&&O[ue]],(0,s.default)({writingDirection:'ltr'},x)),da=ua[0],oa=ua[1];da&&(ye.className=da),oa&&(ye.style=oa),null!=ne&&(0,r(d[5]).warnOnce)('nativeID',"nativeID is deprecated. Use id.");var ba=null!=re?re:ne;return null!=ba&&(ye.id=ba),null!=be&&(ye['data-testid']=be),null==ye.type&&'button'===l&&(ye.type='button'),ye}}),98,[1,5,28,94,27,39]); -__d((function(g,_r,_i,_a,m,_e,d){Object.defineProperty(_e,"__esModule",{value:!0}),_e.LocaleProvider=function(t){var r=t.direction,l=t.locale,c=t.children;return r||l?e.default.createElement(n.Provider,{children:c,value:{direction:l?o(l):r,locale:l}}):c},_e.getLocaleDirection=o,_e.useLocaleContext=function(){return(0,e.useContext)(n)};var e=(function(e,r){if(!r&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=t(r);if(n&&n.has(e))return n.get(e);var o={__proto__:null},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var c in e)if("default"!==c&&{}.hasOwnProperty.call(e,c)){var i=l?Object.getOwnPropertyDescriptor(e,c):null;i&&(i.get||i.set)?Object.defineProperty(o,c,i):o[c]=e[c]}return o.default=e,n&&n.set(e,o),o})(_r(d[0]));function t(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap,n=new WeakMap;return(t=function(e){return e?n:r})(e)}var r={direction:'ltr',locale:'en-US'},n=(0,e.createContext)(r);function o(e){return(0,_r(d[1]).isLocaleRTL)(e)?'rtl':'ltr'}}),99,[14,100]); -__d((function(g,r,i,a,m,e,d){Object.defineProperty(e,"__esModule",{value:!0}),e.isLocaleRTL=function(l){var o=c.get(l);if(o)return o;var s=!1;if(Intl.Locale){var u=new Intl.Locale(l).maximize().script;s=n.has(u)}else{var b=l.split('-')[0];s=t.has(b)}return c.set(l,s),s};var n=new Set(['Arab','Syrc','Samr','Mand','Thaa','Mend','Nkoo','Adlm','Rohg','Hebr']),t=new Set(['ae','ar','arc','bcc','bqi','ckb','dv','fa','far','glk','he','iw','khw','ks','ku','mzn','nqo','pnb','ps','sd','ug','ur','yi']),c=new Map}),100,[]); -__d((function(g,r,i,a,m,e,d){Object.defineProperty(e,"__esModule",{value:!0}),e.touchProps=e.styleProps=e.mouseProps=e.keyboardProps=e.focusProps=e.defaultProps=e.clickProps=e.accessibilityProps=void 0;e.defaultProps={children:!0,dataSet:!0,dir:!0,id:!0,ref:!0,suppressHydrationWarning:!0,tabIndex:!0,testID:!0,focusable:!0,nativeID:!0},e.accessibilityProps={'aria-activedescendant':!0,'aria-atomic':!0,'aria-autocomplete':!0,'aria-busy':!0,'aria-checked':!0,'aria-colcount':!0,'aria-colindex':!0,'aria-colspan':!0,'aria-controls':!0,'aria-current':!0,'aria-describedby':!0,'aria-details':!0,'aria-disabled':!0,'aria-errormessage':!0,'aria-expanded':!0,'aria-flowto':!0,'aria-haspopup':!0,'aria-hidden':!0,'aria-invalid':!0,'aria-keyshortcuts':!0,'aria-label':!0,'aria-labelledby':!0,'aria-level':!0,'aria-live':!0,'aria-modal':!0,'aria-multiline':!0,'aria-multiselectable':!0,'aria-orientation':!0,'aria-owns':!0,'aria-placeholder':!0,'aria-posinset':!0,'aria-pressed':!0,'aria-readonly':!0,'aria-required':!0,role:!0,'aria-roledescription':!0,'aria-rowcount':!0,'aria-rowindex':!0,'aria-rowspan':!0,'aria-selected':!0,'aria-setsize':!0,'aria-sort':!0,'aria-valuemax':!0,'aria-valuemin':!0,'aria-valuenow':!0,'aria-valuetext':!0,accessibilityActiveDescendant:!0,accessibilityAtomic:!0,accessibilityAutoComplete:!0,accessibilityBusy:!0,accessibilityChecked:!0,accessibilityColumnCount:!0,accessibilityColumnIndex:!0,accessibilityColumnSpan:!0,accessibilityControls:!0,accessibilityCurrent:!0,accessibilityDescribedBy:!0,accessibilityDetails:!0,accessibilityDisabled:!0,accessibilityErrorMessage:!0,accessibilityExpanded:!0,accessibilityFlowTo:!0,accessibilityHasPopup:!0,accessibilityHidden:!0,accessibilityInvalid:!0,accessibilityKeyShortcuts:!0,accessibilityLabel:!0,accessibilityLabelledBy:!0,accessibilityLevel:!0,accessibilityLiveRegion:!0,accessibilityModal:!0,accessibilityMultiline:!0,accessibilityMultiSelectable:!0,accessibilityOrientation:!0,accessibilityOwns:!0,accessibilityPlaceholder:!0,accessibilityPosInSet:!0,accessibilityPressed:!0,accessibilityReadOnly:!0,accessibilityRequired:!0,accessibilityRole:!0,accessibilityRoleDescription:!0,accessibilityRowCount:!0,accessibilityRowIndex:!0,accessibilityRowSpan:!0,accessibilitySelected:!0,accessibilitySetSize:!0,accessibilitySort:!0,accessibilityValueMax:!0,accessibilityValueMin:!0,accessibilityValueNow:!0,accessibilityValueText:!0},e.clickProps={onClick:!0,onAuxClick:!0,onContextMenu:!0,onGotPointerCapture:!0,onLostPointerCapture:!0,onPointerCancel:!0,onPointerDown:!0,onPointerEnter:!0,onPointerMove:!0,onPointerLeave:!0,onPointerOut:!0,onPointerOver:!0,onPointerUp:!0},e.focusProps={onBlur:!0,onFocus:!0},e.keyboardProps={onKeyDown:!0,onKeyDownCapture:!0,onKeyUp:!0,onKeyUpCapture:!0},e.mouseProps={onMouseDown:!0,onMouseEnter:!0,onMouseLeave:!0,onMouseMove:!0,onMouseOver:!0,onMouseOut:!0,onMouseUp:!0},e.touchProps={onTouchCancel:!0,onTouchCancelCapture:!0,onTouchEnd:!0,onTouchEndCapture:!0,onTouchMove:!0,onTouchMoveCapture:!0,onTouchStart:!0,onTouchStartCapture:!0},e.styleProps={style:!0}}),101,[]); -__d((function(g,r,i,a,m,e,d){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(n,t){var o={};for(var u in n)n.hasOwnProperty(u)&&!0===t[u]&&(o[u]=n[u]);return o}}),102,[]); -__d((function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,u){var l=v();(0,n.default)((()=>{var n=t.current;null!=n&&(n[o]=u)}),[t,u]),(0,n.default)((()=>{var n=t.current;return null!=n&&null!=l&&('function'==typeof n[o]?l.observe(n):l.unobserve(n)),()=>{null!=n&&null!=l&&l.unobserve(n)}}),[t,l])};var n=t(r(d[1])),u=t(r(d[2])),l=t(r(d[3])),o='__reactLayoutHandler',f=(l.default,null);function v(){return l.default&&void 0!==window.ResizeObserver&&null==f&&(f=new window.ResizeObserver((function(t){t.forEach((t=>{var n=t.target,l=n[o];'function'==typeof l&&u.default.measure(n,((n,u,o,f,v,c)=>{var s={nativeEvent:{layout:{x:n,y:u,width:o,height:f,left:v,top:c}},timeStamp:Date.now()};Object.defineProperty(s.nativeEvent,'target',{enumerable:!0,get:()=>t.target}),l(s)}))}))}))),f}}),103,[1,104,105,23]); -__d((function(g,r,i,a,m,e,d){var f=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=r(d[1]),u=f(r(d[2])).default?t.useLayoutEffect:t.useEffect;e.default=u}),104,[1,14,23]); -__d((function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var o=t(r(d[1])),s=t(r(d[2])),l=t=>{var o=t.offsetHeight,s=t.offsetWidth,l=t.offsetLeft,f=t.offsetTop;for(t=t.offsetParent;t&&1===t.nodeType;)l+=t.offsetLeft+t.clientLeft-t.scrollLeft,f+=t.offsetTop+t.clientTop-t.scrollTop,t=t.offsetParent;return{width:s,height:o,top:f-=window.scrollY,left:l-=window.scrollX}},f=(t,o,s)=>{var f=o||t&&t.parentNode;t&&f&&setTimeout((()=>{if(t.isConnected&&f.isConnected){var o=l(f),n=l(t),u=n.height,c=n.left,p=n.top,b=n.width,h=c-o.left,v=p-o.top;s(h,v,b,u,c,p)}}),0)},n={A:!0,BODY:!0,INPUT:!0,SELECT:!0,TEXTAREA:!0},u={blur(t){try{t.blur()}catch(t){}},focus(t){try{var o=t.nodeName;null==t.getAttribute('tabIndex')&&!0!==t.isContentEditable&&null==n[o]&&t.setAttribute('tabIndex','-1'),t.focus()}catch(t){}},measure(t,o){f(t,null,o)},measureInWindow(t,s){t&&setTimeout((()=>{var l=(0,o.default)(t),f=l.height,n=l.left,u=l.top,c=l.width;s(n,u,c,f)}),0)},measureLayout(t,o,s,l){f(t,o,l)},updateView(t,o){for(var l in o)if(Object.prototype.hasOwnProperty.call(o,l)){var f=o[l];switch(l){case'style':(0,s.default)(t,f);break;case'class':case'className':t.setAttribute('class',f);break;case'text':case'value':t.value=f;break;default:t.setAttribute(l,f)}}},configureNextLayoutAnimation(t,o){o()},setLayoutAnimationEnabledExperimental(){}};e.default=u}),105,[1,106,107]); -__d((function(g,r,i,a,m,e,d){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;e.default=n=>{if(null!=n&&(1===n.nodeType&&'function'==typeof n.getBoundingClientRect))return n.getBoundingClientRect()}}),106,[]); -__d((function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var f=t(r(d[1]));e.default=function(t,o){var l=t.style;for(var n in o)if(o.hasOwnProperty(n)){var u=0===n.indexOf('--'),v=(0,f.default)(n,o[n],u);'float'===n&&(n='cssFloat'),u?l.setProperty(n,v):l[n]=v}}}),107,[1,108]); -__d((function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var u=t(r(d[1]));e.default=function(t,n,o){return null==n||'boolean'==typeof n||''===n?'':o||'number'!=typeof n||0===n||u.default.hasOwnProperty(t)&&u.default[t]?(''+n).trim():n+'px'}}),108,[1,109]); -__d((function(g,r,i,a,m,e,d){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var o={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,flex:!0,flexGrow:!0,flexOrder:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,fontWeight:!0,gridRow:!0,gridRowEnd:!0,gridRowGap:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnGap:!0,gridColumnStart:!0,lineClamp:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0,scale:!0,scaleX:!0,scaleY:!0,scaleZ:!0,shadowOpacity:!0},t=['ms','Moz','O','Webkit'],l=(o,t)=>o+t.charAt(0).toUpperCase()+t.substring(1);Object.keys(o).forEach((s=>{t.forEach((t=>{o[l(t,s)]=o[s]}))}));e.default=o}),109,[]); -__d((function(g,_r,_i,_a,m,_e,d){var e=_r(d[0]);Object.defineProperty(_e,"__esModule",{value:!0}),_e.default=function(){for(var e=arguments.length,n=new Array(e),u=0;u(0,t.default)(...n)),[...n])};var r=(function(e,r){if(!r&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=n(r);if(t&&t.has(e))return t.get(e);var u={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var f in e)if("default"!==f&&{}.hasOwnProperty.call(e,f)){var a=o?Object.getOwnPropertyDescriptor(e,f):null;a&&(a.get||a.set)?Object.defineProperty(u,f,a):u[f]=e[f]}return u.default=e,t&&t.set(e,u),u})(_r(d[1])),t=e(_r(d[2]));function n(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap,t=new WeakMap;return(n=function(e){return e?t:r})(e)}}),110,[1,14,111]); -__d((function(g,_r,_i,_a,m,_e,d){Object.defineProperty(_e,"__esModule",{value:!0}),_e.default=function(){for(var e=arguments.length,r=new Array(e),t=0;t{null!=r&&('function'!=typeof r?'object'!=typeof r?console.error("mergeRefs cannot handle Refs of type boolean, number or string, received ref "+String(r)):r.current=e:r(e))}))}};!(function(r,t){if(!t&&r&&r.__esModule)return r;if(null===r||"object"!=typeof r&&"function"!=typeof r)return{default:r};var n=e(t);if(n&&n.has(r))return n.get(r);var o={__proto__:null},f=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in r)if("default"!==u&&{}.hasOwnProperty.call(r,u)){var a=f?Object.getOwnPropertyDescriptor(r,u):null;a&&(a.get||a.set)?Object.defineProperty(o,u,a):o[u]=r[u]}o.default=r,n&&n.set(r,o)})(_r(d[0]));function e(r){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(e=function(e){return e?n:t})(r)}}),111,[14]); -__d((function(g,r,i,a,m,e,d){var u=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(u){u.pointerEvents,u.style;return(0,n.default)((()=>u=>{null!=u&&(u.measure=n=>t.default.measure(u,n),u.measureLayout=(n,l,o)=>t.default.measureLayout(u,n,o,l),u.measureInWindow=n=>t.default.measureInWindow(u,n))}))};var t=u(r(d[1])),n=u(r(d[2]))}),112,[1,105,113]); -__d((function(g,_r,_i,_a,m,_e,d){Object.defineProperty(_e,"__esModule",{value:!0}),_e.default=function(t){var n=e.useRef(r);n.current===r&&(n.current=t());return n.current};var e=(function(e,r){if(!r&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=t(r);if(n&&n.has(e))return n.get(e);var o={__proto__:null},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var f in e)if("default"!==f&&{}.hasOwnProperty.call(e,f)){var a=u?Object.getOwnPropertyDescriptor(e,f):null;a&&(a.get||a.set)?Object.defineProperty(o,f,a):o[f]=e[f]}return o.default=e,n&&n.set(e,o),o})(_r(d[0]));function t(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap,n=new WeakMap;return(t=function(e){return e?n:r})(e)}var r='function'==typeof Symbol&&'symbol'==typeof Symbol()?Symbol():Object.freeze({})}),113,[14]); -__d((function(g,_r,_i,_a,m,_e,d){Object.defineProperty(_e,"__esModule",{value:!0}),_e.default=function(n,t){void 0===t&&(t=u);var a=l((()=>o++)),c=e.useRef(!1);e.useEffect((()=>(r.attachListeners(),()=>{r.removeNode(a)})),[a]),e.useEffect((()=>{var e=t,u=e.onMoveShouldSetResponder,o=e.onMoveShouldSetResponderCapture,l=e.onScrollShouldSetResponder,f=e.onScrollShouldSetResponderCapture,p=e.onSelectionChangeShouldSetResponder,s=e.onSelectionChangeShouldSetResponderCapture,i=e.onStartShouldSetResponder,S=e.onStartShouldSetResponderCapture,v=null!=u||null!=o||null!=l||null!=f||null!=p||null!=s||null!=i||null!=S,h=n.current;v?(r.addNode(a,h,t),c.current=!0):c.current&&(r.removeNode(a),c.current=!1)}),[t,n,a]),e.useDebugValue({isResponder:n.current===r.getResponderNode()}),e.useDebugValue(t)};var e=t(_r(d[0])),r=t(_r(d[1]));function n(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap,t=new WeakMap;return(n=function(e){return e?t:r})(e)}function t(e,r){if(!r&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=n(r);if(t&&t.has(e))return t.get(e);var u={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in e)if("default"!==l&&{}.hasOwnProperty.call(e,l)){var a=o?Object.getOwnPropertyDescriptor(e,l):null;a&&(a.get||a.set)?Object.defineProperty(u,l,a):u[l]=e[l]}return u.default=e,t&&t.set(e,u),u}var u={},o=0;function l(r){var n=e.useRef(null);return null==n.current&&(n.current=r()),n.current}}),114,[14,115]); -__d((function(g,r,_i2,a,m,e,d){var n=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.addNode=function(n,t,o){(0,r(d[5]).setResponderId)(t,n),p.set(n,o)},e.attachListeners=function(){o.default&&null==window.__reactResponderSystemActive&&(window.addEventListener('blur',T),N.forEach((n=>{document.addEventListener(n,T)})),w.forEach((n=>{document.addEventListener(n,T,!0)})),window.__reactResponderSystemActive=!0)},e.getResponderNode=function(){return v.node},e.removeNode=function(n){v.id===n&&E();p.has(n)&&p.delete(n)},e.terminateResponder=E;var t=n(r(d[1])),o=n(r(d[2])),i={},s=['onStartShouldSetResponderCapture','onStartShouldSetResponder',{bubbles:!0}],l=['onMoveShouldSetResponderCapture','onMoveShouldSetResponder',{bubbles:!0}],u={touchstart:s,mousedown:s,touchmove:l,mousemove:l,scroll:['onScrollShouldSetResponderCapture','onScrollShouldSetResponder',{bubbles:!1}]},c={id:null,idPath:null,node:null},p=new Map,h=!1,f=0,v={id:null,node:null,idPath:null},R=new(r(d[3]).ResponderTouchHistoryStore);function S(n){v=n}function b(n){var t=p.get(n);return null!=t?t:i}function T(n){var o=n.type,i=n.target;if('touchstart'===o&&(h=!0),('touchmove'===o||f>1)&&(h=!1),!('mousedown'===o&&h||'mousemove'===o&&h||'mousemove'===o&&f<1))if(h&&'mouseup'===o)0===f&&(h=!1);else{var s=(0,r(d[4]).isStartish)(o)&&(0,r(d[5]).isPrimaryPointerDown)(n),l=(0,r(d[4]).isMoveish)(o),u=(0,r(d[4]).isEndish)(o),p=(0,r(d[4]).isScroll)(o),T=(0,r(d[4]).isSelectionChange)(o),w=(0,t.default)(n,R);(s||l||u)&&(n.touches?f=n.touches.length:s?f=1:u&&(f=0),R.recordTouchTrack(o,w.nativeEvent));var N,E=(0,r(d[5]).getResponderPaths)(n),_=!1;if(s||l||p&&f>0){var y=v.idPath,M=E.idPath;if(null!=y&&null!=M){var x=(0,r(d[5]).getLowestCommonAncestor)(y,M);if(null!=x){var L=M.indexOf(x)+(x===v.id?1:0);E={idPath:M.slice(L),nodePath:E.nodePath.slice(L)}}else E=null}null!=E&&null!=(N=C(E,n,w))&&(P(w,N),_=!0)}if(null!=v.id&&null!=v.node){var q=v,j=q.id,A=q.node,G=b(j),O=G.onResponderStart,k=G.onResponderMove,D=G.onResponderEnd,H=G.onResponderRelease,I=G.onResponderTerminate,V=G.onResponderTerminationRequest;if(w.bubbles=!1,w.cancelable=!1,w.currentTarget=A,s)null!=O&&(w.dispatchConfig.registrationName='onResponderStart',O(w));else if(l)null!=k&&(w.dispatchConfig.registrationName='onResponderMove',k(w));else{var z=(0,r(d[4]).isCancelish)(o)||'contextmenu'===o||'blur'===o&&i===window||'blur'===o&&i.contains(A)&&n.relatedTarget!==A||p&&0===f||p&&i.contains(A)&&i!==A||T&&(0,r(d[5]).hasValidSelection)(n),B=u&&!z&&!(0,r(d[5]).hasTargetTouches)(A,n.touches);if(u&&null!=D&&(w.dispatchConfig.registrationName='onResponderEnd',D(w)),B&&(null!=H&&(w.dispatchConfig.registrationName='onResponderRelease',H(w)),S(c)),z){var F=!0;'contextmenu'!==o&&'scroll'!==o&&'selectionchange'!==o||(_?F=!1:null!=V&&(w.dispatchConfig.registrationName='onResponderTerminationRequest',!1===V(w)&&(F=!1))),F&&(null!=I&&(w.dispatchConfig.registrationName='onResponderTerminate',I(w)),S(c),h=!1,f=0)}}}}}function C(n,t,o){var i=u[t.type];if(null!=i){for(var s=n.idPath,l=n.nodePath,c=i[0],p=i[1],h=i[2].bubbles,f=function(n,t,i){var l=b(n)[i];if(null!=l&&(o.currentTarget=t,!0===l(o)))return{id:n,node:t,idPath:s.slice(s.indexOf(n))}},v=s.length-1;v>=0;v--){var R=f(s[v],l[v],c);if(null!=R)return R;if(!0===o.isPropagationStopped())return}if(h)for(var S=0;S({force:t.force,identifier:l(t.identifier),get locationX(){return M(t.clientX)},get locationY(){return O(t.clientY)},pageX:t.pageX,pageY:t.pageY,target:t.target,timestamp:j})))}if(null!=h)s=A(h),v=A(t.touches);else{var C=[{force:T,identifier:b,get locationX(){return M(K)},get locationY(){return O(D)},pageX:_,pageY:S,target:t.target,timestamp:j}];s=C,v='mouseup'===X||'dragstart'===X?c:C}var E={bubbles:!0,cancelable:!0,currentTarget:null,defaultPrevented:t.defaultPrevented,dispatchConfig:u,eventPhase:t.eventPhase,isDefaultPrevented:()=>t.defaultPrevented,isPropagationStopped:()=>y,isTrusted:t.isTrusted,nativeEvent:{altKey:!1,ctrlKey:!1,metaKey:Y,shiftKey:P,changedTouches:s,force:T,identifier:b,get locationX(){return M(K)},get locationY(){return O(D)},pageX:_,pageY:S,target:t.target,timestamp:j,touches:v,type:X},persist:o,preventDefault:H,stopPropagation(){y=!0},target:t.target,timeStamp:j,touchHistory:f.touchHistory};function M(t){if(p=p||(0,n.default)(E.currentTarget))return t-p.left}function O(t){if(p=p||(0,n.default)(E.currentTarget))return t-p.top}return E};var n=t(r(d[1])),o=()=>{},u={},c=[];function l(t){return t>20?t%20:t}}),116,[1,106]); -__d((function(g,r,_i,a,m,e,d){Object.defineProperty(e,"__esModule",{value:!0}),e.ResponderTouchHistoryStore=void 0;var t=20;function i(t){return t.timeStamp||t.timestamp}function n(t){return{touchActive:!0,startPageX:t.pageX,startPageY:t.pageY,startTimeStamp:i(t),currentPageX:t.pageX,currentPageY:t.pageY,currentTimeStamp:i(t),previousPageX:t.pageX,previousPageY:t.pageY,previousTimeStamp:i(t)}}function c(t,n){t.touchActive=!0,t.startPageX=n.pageX,t.startPageY=n.pageY,t.startTimeStamp=i(n),t.currentPageX=n.pageX,t.currentPageY=n.pageY,t.currentTimeStamp=i(n),t.previousPageX=n.pageX,t.previousPageY=n.pageY,t.previousTimeStamp=i(n)}function o(t){var i=t.identifier;return null==i&&console.error('Touch object is missing identifier.'),i}function u(t,u){var s=o(t),h=u.touchBank[s];h?c(h,t):u.touchBank[s]=n(t),u.mostRecentTimeStamp=i(t)}function s(t,n){var c=n.touchBank[o(t)];c?(c.touchActive=!0,c.previousPageX=c.currentPageX,c.previousPageY=c.currentPageY,c.previousTimeStamp=c.currentTimeStamp,c.currentPageX=t.pageX,c.currentPageY=t.pageY,c.currentTimeStamp=i(t),n.mostRecentTimeStamp=i(t)):console.warn('Cannot record touch move without a touch start.\n',"Touch Move: "+p(t)+"\n","Touch Bank: "+v(n))}function h(t,n){var c=n.touchBank[o(t)];c?(c.touchActive=!1,c.previousPageX=c.currentPageX,c.previousPageY=c.currentPageY,c.previousTimeStamp=c.currentTimeStamp,c.currentPageX=t.pageX,c.currentPageY=t.pageY,c.currentTimeStamp=i(t),n.mostRecentTimeStamp=i(t)):console.warn('Cannot record touch end without a touch start.\n',"Touch End: "+p(t)+"\n","Touch Bank: "+v(n))}function p(t){return JSON.stringify({identifier:t.identifier,pageX:t.pageX,pageY:t.pageY,timestamp:i(t)})}function v(i){var n=i.touchBank,c=JSON.stringify(n.slice(0,t));return n.length>t&&(c+=' (original size: '+n.length+')'),c}e.ResponderTouchHistoryStore=class{constructor(){this._touchHistory={touchBank:[],numberActiveTouches:0,indexOfSingleActiveTouch:-1,mostRecentTimeStamp:0}}recordTouchTrack(t,i){var n=this._touchHistory;if((0,r(d[0]).isMoveish)(t))i.changedTouches.forEach((t=>s(t,n)));else if((0,r(d[0]).isStartish)(t))i.changedTouches.forEach((t=>u(t,n))),n.numberActiveTouches=i.touches.length,1===n.numberActiveTouches&&(n.indexOfSingleActiveTouch=i.touches[0].identifier);else if((0,r(d[0]).isEndish)(t)&&(i.changedTouches.forEach((t=>h(t,n))),n.numberActiveTouches=i.touches.length,1===n.numberActiveTouches))for(var c=n.touchBank,o=0;o0&&(l=n[c=o-u],o=u);u-o>0&&(i=t[s=u-o],u=o);var f=o;for(;f--;){if(l===i)return l;l=n[c++],i=t[s++]}return null},e.getResponderPaths=function(n){for(var t=[],o=[],l=u(n),i=0;i=1&&'\n'!==n&&c}}),120,[]); -__d((function(g,r,i,a,m,e,d){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=(0,r(d[0]).createContext)(!1);e.default=t}),121,[14]); -__d((function(g,_r,_i,_a,m,_e,d){var e=_r(d[0]);Object.defineProperty(_e,"__esModule",{value:!0}),_e.default=void 0;var o=e(_r(d[1])),n=c(_r(d[2])),r=e(_r(d[3])),t=c(_r(d[4])),l=e(_r(d[5])),a=e(_r(d[6])),s=e(_r(d[7])),u=e(_r(d[8])),p=e(_r(d[9])),i=e(_r(d[10])),S=e(_r(d[11]));function R(e){if("function"!=typeof WeakMap)return null;var o=new WeakMap,n=new WeakMap;return(R=function(e){return e?n:o})(e)}function c(e,o){if(!o&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=R(o);if(n&&n.has(e))return n.get(e);var r={__proto__:null},t=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in e)if("default"!==l&&{}.hasOwnProperty.call(e,l)){var a=t?Object.getOwnPropertyDescriptor(e,l):null;a&&(a.get||a.set)?Object.defineProperty(r,l,a):r[l]=e[l]}return r.default=e,n&&n.set(e,r),r}var f=["hrefAttrs","onLayout","onMoveShouldSetResponder","onMoveShouldSetResponderCapture","onResponderEnd","onResponderGrant","onResponderMove","onResponderReject","onResponderRelease","onResponderStart","onResponderTerminate","onResponderTerminationRequest","onScrollShouldSetResponder","onScrollShouldSetResponderCapture","onSelectionChangeShouldSetResponder","onSelectionChangeShouldSetResponderCapture","onStartShouldSetResponder","onStartShouldSetResponderCapture"],h=Object.assign({},t.defaultProps,t.accessibilityProps,t.clickProps,t.focusProps,t.keyboardProps,t.mouseProps,t.touchProps,t.styleProps,{href:!0,lang:!0,onScroll:!0,onWheel:!0,pointerEvents:!0}),v=e=>(0,l.default)(e,h),y=n.forwardRef(((e,t)=>{var l=e.hrefAttrs,i=e.onLayout,R=e.onMoveShouldSetResponder,c=e.onMoveShouldSetResponderCapture,h=e.onResponderEnd,y=e.onResponderGrant,b=e.onResponderMove,w=e.onResponderReject,M=e.onResponderRelease,P=e.onResponderStart,_=e.onResponderTerminate,x=e.onResponderTerminationRequest,j=e.onScrollShouldSetResponder,O=e.onScrollShouldSetResponderCapture,k=e.onSelectionChangeShouldSetResponder,D=e.onSelectionChangeShouldSetResponderCapture,T=e.onStartShouldSetResponder,W=e.onStartShouldSetResponderCapture,E=(0,o.default)(e,f),L=n.useContext(S.default),q=n.useRef(null),A=(0,_r(d[12]).useLocaleContext)().direction;(0,a.default)(q,i),(0,p.default)(q,{onMoveShouldSetResponder:R,onMoveShouldSetResponderCapture:c,onResponderEnd:h,onResponderGrant:y,onResponderMove:b,onResponderReject:w,onResponderRelease:M,onResponderStart:P,onResponderTerminate:_,onResponderTerminationRequest:x,onScrollShouldSetResponder:j,onScrollShouldSetResponderCapture:O,onSelectionChangeShouldSetResponder:k,onSelectionChangeShouldSetResponderCapture:D,onStartShouldSetResponder:T,onStartShouldSetResponderCapture:W});var G='div',z=null!=e.lang?(0,_r(d[12]).getLocaleDirection)(e.lang):null,I=e.dir||z,$=I||A,B=v(E);if(B.dir=I,B.style=[C.view$raw,L&&C.inline,e.style],null!=e.href&&(G='a',null!=l)){var H=l.download,N=l.rel,V=l.target;null!=H&&(B.download=H),null!=N&&(B.rel=N),'string'==typeof V&&(B.target='_'!==V.charAt(0)?'_'+V:V)}var F=(0,u.default)(B),J=(0,s.default)(q,F,t);return B.ref=J,(0,r.default)(G,B,{writingDirection:$})}));y.displayName='View';var C=i.default.create({view$raw:{alignItems:'stretch',backgroundColor:'transparent',border:'0 solid black',boxSizing:'border-box',display:'flex',flexBasis:'auto',flexDirection:'column',flexShrink:0,listStyle:'none',margin:0,minHeight:0,minWidth:0,padding:0,position:'relative',textDecoration:'none',zIndex:0},inline:{display:'inline-flex'}});_e.default=y}),122,[1,28,14,93,101,102,103,110,112,114,27,121,99]); -__d((function(g,r,i,a,m,e,d){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var l={ignoreLogs(){},ignoreAllLogs(){},uninstall(){},install(){}};e.default=l}),123,[]); -__d((function(g,_r,_i,_a,m,_e,d){var e=_r(d[0]);Object.defineProperty(_e,"__esModule",{value:!0}),_e.default=void 0;var t=e(_r(d[1])),r=e(_r(d[2])),a=(function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=i(t);if(r&&r.has(e))return r.get(e);var a={__proto__:null},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&{}.hasOwnProperty.call(e,o)){var f=n?Object.getOwnPropertyDescriptor(e,o):null;f&&(f.get||f.set)?Object.defineProperty(a,o,f):a[o]=e[o]}return a.default=e,r&&r.set(e,a),a})(_r(d[3])),n=e(_r(d[4])),o=e(_r(d[5])),f=e(_r(d[6]));function i(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(i=function(e){return e?r:t})(e)}var u=["style"],l=f.default&&window.CSS&&window.CSS.supports&&window.CSS.supports('top: constant(safe-area-inset-top)')?'constant':'env',p=a.forwardRef(((e,n)=>{var f=e.style,i=(0,r.default)(e,u);return a.createElement(o.default,(0,t.default)({},i,{ref:n,style:[s.root,f]}))}));p.displayName='SafeAreaView';var s=n.default.create({root:{paddingTop:l+"(safe-area-inset-top)",paddingRight:l+"(safe-area-inset-right)",paddingBottom:l+"(safe-area-inset-bottom)",paddingLeft:l+"(safe-area-inset-left)"}});_e.default=p}),124,[1,19,28,14,27,122,23]); -__d((function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var f=t(r(d[1]));const l={matchParent:{flex:1}};e.default=f.default.create(l)}),125,[1,27]); -__d((function(g,r,i,a,m,e,d){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;e.default={primary:{blueDark:'#314ccd',blue:'#4264fb',blueLight:'#aab7ef',blueFaint:'#edf0fd',grayDark:'#273d56',gray:'#607d9c',grayLight:'#c6d2e1',grayFaint:'#f4f7fb',pinkDark:'#b43b71',pink:'#ee4e8b',pinkLight:'#f8c8da',pinkFaint:'#fbe5ee'},secondary:{purpleDark:'#5a3fc0',purple:'#7753eb',purpleLight:'#c5b9eb',purpleFaint:'#f2effa',orangeDark:'#ba7334',orange:'#f79640',orangeLight:'#fbcea6',orangeFaint:'#feefe2',greenDark:'#269561',green:'#33c377',greenLight:'#afdec5',greenFaint:'#e8f5ee',yellowDark:'#a4a62d',yellow:'#d9d838',yellowLight:'#FFF5A0',yellowFaint:'#FCFCDF',redDark:'#ba3b3f',red:'#f74e4e',redLight:'#f6b7b7',redFaint:'#fbe5e5',white:'#ffffff',black:'#000000'}}}),126,[]); -__d((function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var u=t(r(d[1]));const l=new class{get(t){return u.default[t]}};e.default=l}),127,[1,128]); -__d((function(n,Y,b,c,i,o,t){i.exports={accessToken:"pk.eyJ1IjoicmVhY3RuYXRpdmVtYXBib3hnbCIsImEiOiJjbHhnN3RkYW4wcjYxMmlzMzNobHNvYnU5In0.7bndJT9CtMLTtvHBkjXLKA"}}),128,[]); -__d((function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"NativeStackView",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(e,"createNativeStackNavigator",{enumerable:!0,get:function(){return n.default}});var n=t(r(d[1])),u=t(r(d[2]))}),129,[1,130,131]); -__d((function(g,_r,_i,_a,m,_e,d){var e=_r(d[0]);Object.defineProperty(_e,"__esModule",{value:!0}),_e.default=void 0;var t=e(_r(d[1])),n=(function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=a(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&{}.hasOwnProperty.call(e,o)){var s=i?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(r,o,s):r[o]=e[o]}return r.default=e,n&&n.set(e,r),r})(_r(d[2])),r=e(_r(d[3]));const i=["id","initialRouteName","children","screenListeners","screenOptions"];function a(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(a=function(e){return e?n:t})(e)}function o(){return o=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var e;return null==O||null===(e=O.addListener)||void 0===e?void 0:e.call(O,'tabPress',(e=>{const t=O.isFocused();requestAnimationFrame((()=>{p.index>0&&t&&!e.defaultPrevented&&O.dispatch(Object.assign({},_r(d[4]).StackActions.popToTop(),{target:p.key}))}))}))}),[O,p.index,p.key]),n.createElement(y,null,n.createElement(r.default,o({},f,{state:p,navigation:O,descriptors:v})))}))}),130,[1,28,14,131,139]); -__d((function(g,_r,_i,_a,m,_e,d){var e=_r(d[0]);Object.defineProperty(_e,"__esModule",{value:!0}),_e.default=function(e){let{state:o,descriptors:c}=e;const u=t.useContext(_r(d[5]).HeaderBackContext);return t.createElement(_r(d[5]).SafeAreaProviderCompat,null,t.createElement(a.default,{style:i.container},o.routes.map(((e,s)=>{var f,h;const p=o.index===s,v=null===(f=o.routes[s-1])||void 0===f?void 0:f.key,y=null===(h=o.routes[s+1])||void 0===h?void 0:h.key,k=v?c[v]:void 0,C=y?c[y]:void 0,{options:b,navigation:T,render:B}=c[e.key],S=k?{title:(0,_r(d[5]).getHeaderTitle)(k.options,k.route.name)}:u,w=void 0!==S,{header:_,headerShown:P,headerTintColor:E,headerBackImageSource:M,headerLeft:O,headerRight:x,headerTitle:j,headerTitleAlign:H,headerTitleStyle:I,headerStyle:A,headerShadowVisible:G,headerTransparent:W,headerBackground:D,headerBackTitle:L,presentation:R,contentStyle:V}=b,z=null==C?void 0:C.options.presentation;return t.createElement(_r(d[5]).Screen,{key:e.key,focused:p,route:e,navigation:T,headerShown:P,headerTransparent:W,header:void 0!==_?_({back:S,options:b,route:e,navigation:T}):t.createElement(_r(d[5]).Header,{title:(0,_r(d[5]).getHeaderTitle)(b,e.name),headerTintColor:E,headerLeft:'function'==typeof O?e=>{let{tintColor:t}=e;return O({tintColor:t,canGoBack:w,label:L})}:void 0===O&&w?e=>{let{tintColor:n}=e;return t.createElement(_r(d[5]).HeaderBackButton,{tintColor:n,backImage:void 0!==M?()=>t.createElement(r.default,{source:M,style:[i.backImage,{tintColor:n}]}):void 0,onPress:T.goBack,canGoBack:w})}:O,headerRight:'function'==typeof x?e=>{let{tintColor:t}=e;return x({tintColor:t,canGoBack:w})}:x,headerTitle:'function'==typeof j?e=>{let{children:t,tintColor:r}=e;return j({children:t,tintColor:r})}:j,headerTitleAlign:H,headerTitleStyle:I,headerTransparent:W,headerShadowVisible:G,headerBackground:D,headerStyle:A}),style:[n.default.absoluteFill,{display:p||null!=z&&l.includes(z)?'flex':'none'},null!=R&&l.includes(R)?{backgroundColor:'transparent'}:null]},t.createElement(_r(d[5]).HeaderBackContext.Provider,{value:S},t.createElement(a.default,{style:[i.contentContainer,V]},B())))}))))};var t=(function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=o(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in e)if("default"!==l&&{}.hasOwnProperty.call(e,l)){var i=a?Object.getOwnPropertyDescriptor(e,l):null;i&&(i.get||i.set)?Object.defineProperty(n,l,i):n[l]=e[l]}return n.default=e,r&&r.set(e,n),n})(_r(d[1])),r=e(_r(d[2])),n=e(_r(d[3])),a=e(_r(d[4]));function o(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(o=function(e){return e?r:t})(e)}const l=['transparentModal','containedTransparentModal'];const i=n.default.create({container:{flex:1},contentContainer:{flex:1},backImage:{height:24,width:24,margin:3,resizeMode:'contain'}})}),131,[1,14,132,27,122,137]); -__d((function(g,_r,_i,_a,m,_e,d){var e=_r(d[0]);Object.defineProperty(_e,"__esModule",{value:!0}),_e.default=void 0;var t=e(_r(d[1])),r=e(_r(d[2])),a=e(_r(d[3])),n=(function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=f(t);if(r&&r.has(e))return r.get(e);var a={__proto__:null},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&{}.hasOwnProperty.call(e,o)){var l=n?Object.getOwnPropertyDescriptor(e,o):null;l&&(l.get||l.set)?Object.defineProperty(a,o,l):a[o]=e[o]}return a.default=e,r&&r.set(e,a),a})(_r(d[4])),o=e(_r(d[5])),l=e(_r(d[6])),u=e(_r(d[7])),i=e(_r(d[8])),s=e(_r(d[9])),c=e(_r(d[10]));function f(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(f=function(e){return e?r:t})(e)}var p=["aria-label","accessibilityLabel","blurRadius","defaultSource","draggable","onError","onLayout","onLoad","onLoadEnd","onLoadStart","pointerEvents","source","style"],h='LOADED',b='LOADING',y=0,v=/^(data:image\/svg\+xml;utf8,)(.*)/;function w(e,t){return e&&null!=t?n.createElement("svg",{style:{position:'absolute',height:0,visibility:'hidden',width:0}},n.createElement("defs",null,n.createElement("filter",{id:"tint-"+t,suppressHydrationWarning:!0},n.createElement("feFlood",{floodColor:""+e,key:e}),n.createElement("feComposite",{in2:"SourceAlpha",operator:"atop"})))):null}function E(e,t,r,a){var n=i.default.flatten(e),o=n.filter,l=n.resizeMode,u=n.shadowOffset,s=n.tintColor;n.resizeMode&&(0,_r(d[11]).warnOnce)('Image.style.resizeMode','Image: style.resizeMode is deprecated. Please use props.resizeMode.'),n.tintColor&&(0,_r(d[11]).warnOnce)('Image.style.tintColor','Image: style.tintColor is deprecated. Please use props.tintColor.');var c=[],f=null;if(o&&c.push(o),t&&c.push("blur("+t+"px)"),u){var p=(0,_r(d[12]).createBoxShadowValue)(n);p&&c.push("drop-shadow("+p+")")}return(a||s)&&null!=r&&c.push("url(#tint-"+r+")"),c.length>0&&(f=c.join(' ')),[l,f,s]}function k(e){if('number'==typeof e){var t=(0,_r(d[13]).getAssetByID)(e);return{height:t.height,width:t.width}}if(null!=e&&!Array.isArray(e)&&'object'==typeof e)return{height:e.height,width:e.width}}function z(e){var t=null;if('number'==typeof e){var r=(0,_r(d[13]).getAssetByID)(e);if(null==r)throw new Error("Image: asset with ID \""+e+"\" could not be found. Please check the image source or packager.");var a=r.scales[0];if(r.scales.length>1){var n=u.default.get();a=r.scales.reduce(((e,t)=>Math.abs(t-n){var u=e['aria-label'],i=e.accessibilityLabel,f=e.blurRadius,v=e.defaultSource,S=e.draggable,I=e.onError,M=e.onLayout,L=e.onLoad,R=e.onLoadEnd,x=e.onLoadStart,P=e.pointerEvents,j=e.source,D=e.style,_=(0,a.default)(e,p),A=u||i,W=n.useState((()=>{var e=z(j);if(null!=e&&l.default.has(e))return h;return"IDLE"})),B=W[0],F=W[1],H=n.useState({}),q=H[0],N=H[1],$=n.useContext(s.default),G=n.useRef(null),U=n.useRef(y++),V=n.useRef(null),J=B===h||B===b&&null==v,K=E(D,f,U.current,e.tintColor),Q=K[0],T=K[1],X=K[2],Y=e.resizeMode||Q||'cover',Z=e.tintColor||X,ee=J?j:v,te=z(ee),re=k(ee),ae=te?"url(\""+te+"\")":null,ne=(function(){if(null!=G.current&&('center'===Y||'repeat'===Y)){var e=G.current,t=e.naturalHeight,r=e.naturalWidth,a=q.height,n=q.width;if(t&&r&&a&&n){var o=Math.min(1,n/r,a/t);return Math.ceil(o*r)+"px "+Math.ceil(o*t)+"px"}}})(),oe=te?(0,o.default)('img',{alt:A||'',style:O.accessibilityImage$raw,draggable:S||!1,ref:G,src:te}):null;var le=z(j);return n.useEffect((()=>{function e(){null!=V.current&&(l.default.abort(V.current),V.current=null)}return e(),null!=le&&(F(b),x&&x(),V.current=l.default.load(le,(function(e){F(h),L&&L(e),R&&R()}),(function(){F("ERRORED"),I&&I({nativeEvent:{error:"Failed to load resource "+le+" (404)"}}),R&&R()}))),e}),[le,V,F,I,L,R,x]),n.createElement(c.default,(0,r.default)({},_,{"aria-label":A,onLayout:function(e){if('center'===Y||'repeat'===Y||M){var t=e.nativeEvent.layout;M&&M(e),N(t)}},pointerEvents:P,ref:t,style:[O.root,$&&O.inline,re,D,O.undo,{boxShadow:null}]}),n.createElement(c.default,{style:[O.image,C[Y],{backgroundImage:ae,filter:T},null!=ne&&{backgroundSize:ne}],suppressHydrationWarning:!0}),oe,w(Z,U.current))}));S.displayName='Image';var I=S;I.getSize=function(e,t,r){l.default.getSize(e,t,r)},I.prefetch=function(e){return l.default.prefetch(e)},I.queryCache=function(e){return l.default.queryCache(e)};var O=i.default.create({root:{flexBasis:'auto',overflow:'hidden',zIndex:0},inline:{display:'inline-flex'},undo:{blurRadius:null,shadowColor:null,shadowOpacity:null,shadowOffset:null,shadowRadius:null,tintColor:null,overlayColor:null,resizeMode:null},image:(0,t.default)((0,t.default)({},i.default.absoluteFillObject),{},{backgroundColor:'transparent',backgroundPosition:'center',backgroundRepeat:'no-repeat',backgroundSize:'cover',height:'100%',width:'100%',zIndex:-1}),accessibilityImage$raw:(0,t.default)((0,t.default)({},i.default.absoluteFillObject),{},{height:'100%',opacity:0,width:'100%',zIndex:-1})}),C=i.default.create({center:{backgroundSize:'auto'},contain:{backgroundSize:'contain'},cover:{backgroundSize:'cover'},none:{backgroundPosition:'0',backgroundSize:'auto'},repeat:{backgroundPosition:'0',backgroundRepeat:'repeat',backgroundSize:'auto'},stretch:{backgroundSize:'100% 100%'}});_e.default=I}),132,[1,5,19,28,14,93,133,134,27,121,122,39,32,136]); -__d((function(g,r,i,a,m,_e,d){Object.defineProperty(_e,"__esModule",{value:!0}),_e.default=_e.ImageUriCache=void 0;var e=/^data:/;class t{static has(n){var o=t._entries;return e.test(n)||Boolean(o[n])}static add(e){var n=t._entries,o=Date.now();n[e]?(n[e].lastUsedTimestamp=o,n[e].refCount+=1):n[e]={lastUsedTimestamp:o,refCount:1}}static remove(e){var n=t._entries;n[e]&&(n[e].refCount-=1),t._cleanUpIfNeeded()}static _cleanUpIfNeeded(){var e,n,o=t._entries,s=Object.keys(o);s.length+1>t._maximumEntries&&(s.forEach((t=>{var s=o[t];(!n||s.lastUsedTimestampt.has(e),load(e,t,s){n+=1;var l=new window.Image;return l.onerror=s,l.onload=e=>{var n=()=>t({nativeEvent:e});'function'==typeof l.decode?l.decode().then(n,n):setTimeout(n,0)},l.src=e,o[""+n]=l,n},prefetch:e=>new Promise(((n,o)=>{s.load(e,(()=>{t.add(e),t.remove(e),n()}),o)})),queryCache(e){var n={};return e.forEach((e=>{t.has(e)&&(n[e]='disk/memory')})),Promise.resolve(n)}};_e.default=s}),133,[]); -__d((function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var u=t(r(d[1]));class n{static get(){return u.default.get('window').scale}static getFontScale(){return u.default.get('window').fontScale||n.get()}static getPixelSizeForLayoutSize(t){return Math.round(t*n.get())}static roundToNearestPixel(t){var u=n.get();return Math.round(t*u)/u}}e.default=n}),134,[1,135]); -__d((function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=t(r(d[1])),s=t(r(d[2])),o={window:{fontScale:1,height:0,scale:1,width:0},screen:{fontScale:1,height:0,scale:1,width:0}},c={},l=s.default;function w(){if(s.default){var t,n,c=window;if(c.visualViewport){var l=c.visualViewport;t=Math.round(l.height*l.scale),n=Math.round(l.width*l.scale)}else{var w=c.document.documentElement;t=w.clientHeight,n=w.clientWidth}o.window={fontScale:1,height:t,scale:c.devicePixelRatio||1,width:n},o.screen={fontScale:1,height:c.screen.height,scale:c.devicePixelRatio||1,width:c.screen.width}}}function h(){w(),Array.isArray(c.change)&&c.change.forEach((t=>t(o)))}e.default=class{static get(t){return l&&(l=!1,w()),(0,n.default)(o[t],"No dimension set for key "+t),o[t]}static set(t){t&&(s.default?(0,n.default)(!1,'Dimensions cannot be set in the browser'):(null!=t.screen&&(o.screen=t.screen),null!=t.window&&(o.window=t.window)))}static addEventListener(t,n){return c[t]=c[t]||[],c[t].push(n),{remove:()=>{this.removeEventListener(t,n)}}}static removeEventListener(t,n){Array.isArray(c[t])&&(c[t]=c[t].filter((t=>t!==n)))}},s.default&&(window.visualViewport?window.visualViewport.addEventListener('resize',h,!1):window.addEventListener('resize',h,!1))}),135,[1,10,23]); -__d((function(g,r,i,a,m,e,d){'use strict';const t=[];m.exports={registerAsset:function(s){return t.push(s)},getAssetByID:function(s){return t[s-1]}}}),136,[]); -__d((function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0});var n={Assets:!0,Background:!0,getDefaultHeaderHeight:!0,getHeaderTitle:!0,Header:!0,HeaderBackButton:!0,HeaderBackContext:!0,HeaderBackground:!0,HeaderHeightContext:!0,HeaderShownContext:!0,HeaderTitle:!0,useHeaderHeight:!0,MissingIcon:!0,PlatformPressable:!0,ResourceSavingView:!0,SafeAreaProviderCompat:!0,Screen:!0};e.Assets=void 0,Object.defineProperty(e,"Background",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(e,"Header",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(e,"HeaderBackButton",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(e,"HeaderBackContext",{enumerable:!0,get:function(){return b.default}}),Object.defineProperty(e,"HeaderBackground",{enumerable:!0,get:function(){return H.default}}),Object.defineProperty(e,"HeaderHeightContext",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(e,"HeaderShownContext",{enumerable:!0,get:function(){return P.default}}),Object.defineProperty(e,"HeaderTitle",{enumerable:!0,get:function(){return p.default}}),Object.defineProperty(e,"MissingIcon",{enumerable:!0,get:function(){return O.default}}),Object.defineProperty(e,"PlatformPressable",{enumerable:!0,get:function(){return j.default}}),Object.defineProperty(e,"ResourceSavingView",{enumerable:!0,get:function(){return h.default}}),Object.defineProperty(e,"SafeAreaProviderCompat",{enumerable:!0,get:function(){return B.default}}),Object.defineProperty(e,"Screen",{enumerable:!0,get:function(){return k.default}}),Object.defineProperty(e,"getDefaultHeaderHeight",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(e,"getHeaderTitle",{enumerable:!0,get:function(){return f.default}}),Object.defineProperty(e,"useHeaderHeight",{enumerable:!0,get:function(){return y.default}});var u=t(r(d[1])),o=t(r(d[2])),f=t(r(d[3])),c=t(r(d[4])),l=t(r(d[5])),b=t(r(d[6])),H=t(r(d[7])),s=t(r(d[8])),P=t(r(d[9])),p=t(r(d[10])),y=t(r(d[11])),O=t(r(d[12])),j=t(r(d[13])),h=t(r(d[14])),B=t(r(d[15])),k=t(r(d[16]));Object.keys(r(d[17])).forEach((function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(n,t)||t in e&&e[t]===r(d[17])[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return r(d[17])[t]}}))}));e.Assets=[r(d[18]),r(d[19])]}),137,[1,138,236,237,238,331,344,321,345,322,324,346,347,334,348,349,350,351,342,343]); -__d((function(g,_r,_i,_a,m,_e,d){var e=_r(d[0]);Object.defineProperty(_e,"__esModule",{value:!0}),_e.default=function(e){let{style:u}=e,l=(0,t.default)(e,o);const{colors:f}=(0,_r(d[4]).useTheme)();return r.createElement(n.default,a({},l,{style:[{flex:1,backgroundColor:f.background},u]}))};var t=e(_r(d[1])),r=(function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=u(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&{}.hasOwnProperty.call(e,a)){var l=o?Object.getOwnPropertyDescriptor(e,a):null;l&&(l.get||l.set)?Object.defineProperty(n,a,l):n[a]=e[a]}return n.default=e,r&&r.set(e,n),n})(_r(d[2])),n=e(_r(d[3]));const o=["style"];function u(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(u=function(e){return e?r:t})(e)}function a(){return a=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var t;'onPress'in f&&(null===(t=f.onPress)||void 0===t||t.call(f,e)),c.onPress(e)}}))};var t=e(_r(d[1])),n=(function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=u(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&{}.hasOwnProperty.call(e,a)){var l=o?Object.getOwnPropertyDescriptor(e,a):null;l&&(l.get||l.set)?Object.defineProperty(r,a,l):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r})(_r(d[2])),r=(e(_r(d[3])),e(_r(d[4]))),o=e(_r(d[5]));const a=["to","action"];function u(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(u=function(e){return e?n:t})(e)}}),140,[1,28,14,77,92,141]); -__d((function(g,_r,_i,_a,m,_e,d){var e=_r(d[0]);Object.defineProperty(_e,"__esModule",{value:!0}),_e.default=function(e){let{to:a,action:i}=e;const l=t.useContext(_r(d[5]).NavigationContainerRefContext),u=t.useContext(_r(d[5]).NavigationHelpersContext),{options:s}=t.useContext(n.default),f=(0,r.default)(),c=(null==s?void 0:s.getPathFromState)??_r(d[5]).getPathFromState;return{href:'string'==typeof a?a:c({routes:[{name:a.screen,params:a.params,state:o(a.params)}]},null==s?void 0:s.config),accessibilityRole:'link',onPress:e=>{var t;let n=!1;if(e?e.defaultPrevented||e.metaKey||e.altKey||e.ctrlKey||e.shiftKey||null!=e.button&&0!==e.button||![void 0,null,'','self'].includes(null===(t=e.currentTarget)||void 0===t?void 0:t.target)||(e.preventDefault(),n=!0):n=!e||!e.defaultPrevented,n)if(i)if(u)u.dispatch(i);else{if(!l)throw new Error("Couldn't find a navigation object. Is your component inside NavigationContainer?");l.dispatch(i)}else f(a)}}};var t=(function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=a(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&{}.hasOwnProperty.call(e,i)){var l=o?Object.getOwnPropertyDescriptor(e,i):null;l&&(l.get||l.set)?Object.defineProperty(r,i,l):r[i]=e[i]}return r.default=e,n&&n.set(e,r),r})(_r(d[1])),n=(e(_r(d[2])),e(_r(d[3]))),r=e(_r(d[4]));function a(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(a=function(e){return e?n:t})(e)}const o=e=>null!=e&&e.state?e.state:null!=e&&e.screen?{routes:[{name:e.screen,params:e.params,state:e.screen?o(e.params):void 0}]}:void 0}),141,[1,14,77,142,143,144]); -__d((function(g,_r,_i,_a,m,_e,d){function e(t){if("function"!=typeof WeakMap)return null;var n=new WeakMap,r=new WeakMap;return(e=function(e){return e?r:n})(t)}Object.defineProperty(_e,"__esModule",{value:!0}),_e.default=void 0;const t=(function(t,n){if(!n&&t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var r=e(n);if(r&&r.has(t))return r.get(t);var o={__proto__:null},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in t)if("default"!==a&&{}.hasOwnProperty.call(t,a)){var f=u?Object.getOwnPropertyDescriptor(t,a):null;f&&(f.get||f.set)?Object.defineProperty(o,a,f):o[a]=t[a]}return o.default=t,r&&r.set(t,o),o})(_r(d[0])).createContext({options:void 0});t.displayName='LinkingContext';_e.default=t}),142,[14]); -__d((function(g,_r,_i,_a,m,_e,d){var t=_r(d[0]);Object.defineProperty(_e,"__esModule",{value:!0}),_e.default=function(){const t=e.useContext(_r(d[3]).NavigationContainerRefContext),r=e.useContext(n.default);return e.useCallback((e=>{if(void 0===t)throw new Error("Couldn't find a navigation object. Is your component inside NavigationContainer?");if('string'!=typeof e)return void t.navigate(e.screen,e.params);if(!e.startsWith('/'))throw new Error(`The path must start with '/' (${e}).`);const{options:n}=r,o=null!=n&&n.getStateFromPath?n.getStateFromPath(e,n.config):(0,_r(d[3]).getStateFromPath)(e,null==n?void 0:n.config);if(!o)throw new Error('Failed to parse the path to a navigation state.');{const e=(0,_r(d[3]).getActionFromState)(o,null==n?void 0:n.config);void 0!==e?t.dispatch(e):t.reset(o)}}),[r,t])};var e=(function(t,e){if(!e&&t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var n=r(e);if(n&&n.has(t))return n.get(t);var o={__proto__:null},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in t)if("default"!==i&&{}.hasOwnProperty.call(t,i)){var u=a?Object.getOwnPropertyDescriptor(t,i):null;u&&(u.get||u.set)?Object.defineProperty(o,i,u):o[i]=t[i]}return o.default=t,n&&n.set(t,o),o})(_r(d[1])),n=t(_r(d[2]));function r(t){if("function"!=typeof WeakMap)return null;var e=new WeakMap,n=new WeakMap;return(r=function(t){return t?n:e})(t)}}),143,[1,14,142,144]); -__d((function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0});var n={BaseNavigationContainer:!0,createNavigationContainerRef:!0,createNavigatorFactory:!0,CurrentRenderContext:!0,findFocusedRoute:!0,getActionFromState:!0,getFocusedRouteNameFromRoute:!0,getPathFromState:!0,getStateFromPath:!0,NavigationContainerRefContext:!0,NavigationContext:!0,NavigationHelpersContext:!0,NavigationRouteContext:!0,PreventRemoveContext:!0,PreventRemoveProvider:!0,useFocusEffect:!0,useIsFocused:!0,useNavigation:!0,useNavigationBuilder:!0,useNavigationContainerRef:!0,useNavigationState:!0,UNSTABLE_usePreventRemove:!0,usePreventRemoveContext:!0,useRoute:!0,validatePathConfig:!0};Object.defineProperty(e,"BaseNavigationContainer",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(e,"CurrentRenderContext",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(e,"NavigationContainerRefContext",{enumerable:!0,get:function(){return p.default}}),Object.defineProperty(e,"NavigationContext",{enumerable:!0,get:function(){return y.default}}),Object.defineProperty(e,"NavigationHelpersContext",{enumerable:!0,get:function(){return O.default}}),Object.defineProperty(e,"NavigationRouteContext",{enumerable:!0,get:function(){return j.default}}),Object.defineProperty(e,"PreventRemoveContext",{enumerable:!0,get:function(){return C.default}}),Object.defineProperty(e,"PreventRemoveProvider",{enumerable:!0,get:function(){return N.default}}),Object.defineProperty(e,"UNSTABLE_usePreventRemove",{enumerable:!0,get:function(){return B.default}}),Object.defineProperty(e,"createNavigationContainerRef",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(e,"createNavigatorFactory",{enumerable:!0,get:function(){return f.default}}),Object.defineProperty(e,"findFocusedRoute",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(e,"getActionFromState",{enumerable:!0,get:function(){return b.default}}),Object.defineProperty(e,"getFocusedRouteNameFromRoute",{enumerable:!0,get:function(){return v.default}}),Object.defineProperty(e,"getPathFromState",{enumerable:!0,get:function(){return P.default}}),Object.defineProperty(e,"getStateFromPath",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(e,"useFocusEffect",{enumerable:!0,get:function(){return R.default}}),Object.defineProperty(e,"useIsFocused",{enumerable:!0,get:function(){return F.default}}),Object.defineProperty(e,"useNavigation",{enumerable:!0,get:function(){return x.default}}),Object.defineProperty(e,"useNavigationBuilder",{enumerable:!0,get:function(){return h.default}}),Object.defineProperty(e,"useNavigationContainerRef",{enumerable:!0,get:function(){return S.default}}),Object.defineProperty(e,"useNavigationState",{enumerable:!0,get:function(){return _.default}}),Object.defineProperty(e,"usePreventRemoveContext",{enumerable:!0,get:function(){return E.default}}),Object.defineProperty(e,"useRoute",{enumerable:!0,get:function(){return A.default}}),Object.defineProperty(e,"validatePathConfig",{enumerable:!0,get:function(){return M.default}});var o=t(r(d[1])),u=t(r(d[2])),f=t(r(d[3])),c=t(r(d[4])),l=t(r(d[5])),b=t(r(d[6])),v=t(r(d[7])),P=t(r(d[8])),s=t(r(d[9])),p=t(r(d[10])),y=t(r(d[11])),O=t(r(d[12])),j=t(r(d[13])),C=t(r(d[14])),N=t(r(d[15]));Object.keys(r(d[16])).forEach((function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(n,t)||t in e&&e[t]===r(d[16])[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return r(d[16])[t]}}))}));var R=t(r(d[17])),F=t(r(d[18])),x=t(r(d[19])),h=t(r(d[20])),S=t(r(d[21])),_=t(r(d[22])),B=t(r(d[23])),E=t(r(d[24])),A=t(r(d[25])),M=t(r(d[26]));Object.keys(r(d[27])).forEach((function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(n,t)||t in e&&e[t]===r(d[27])[t]||Object.defineProperty(e,t,{enumerable:!0,get:function(){return r(d[27])[t]}}))}))}),144,[1,145,161,171,174,149,175,176,178,186,151,152,188,153,189,190,193,194,196,195,197,214,215,216,217,218,185,162]); -__d((function(g,_r,_i,_a,m,_e,d){var e=_r(d[0]);Object.defineProperty(_e,"__esModule",{value:!0}),_e.default=void 0;var t=e(_r(d[1])),n=(function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=k(t);if(n&&n.has(e))return n.get(e);var a={__proto__:null},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&{}.hasOwnProperty.call(e,o)){var u=r?Object.getOwnPropertyDescriptor(e,o):null;u&&(u.get||u.set)?Object.defineProperty(a,o,u):a[o]=e[o]}return a.default=e,n&&n.set(e,a),a})(_r(d[2])),a=(e(_r(d[3])),e(_r(d[4])),e(_r(d[5]))),r=e(_r(d[6])),o=e(_r(d[7])),u=e(_r(d[8])),s=e(_r(d[9])),l=e(_r(d[10])),c=e(_r(d[11])),i=e(_r(d[12])),f=e(_r(d[13])),p=e(_r(d[14])),v=e(_r(d[15])),y=e(_r(d[16])),h=e(_r(d[17]));const b=["key","routeNames"];function k(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(k=function(e){return e?n:t})(e)}const O=e=>{if(void 0===e)return;const n=(0,t.default)(e,b);return Object.assign({},n,{stale:!0,routes:e.routes.map((e=>void 0===e.state?e:Object.assign({},e,{state:O(e.state)})))})},C=n.forwardRef((function(e,t){let{initialState:b,onStateChange:k,onUnhandledAction:C,independent:R,children:_}=e;if(!n.useContext(c.default).isDefault&&!R)throw new Error("Looks like you have nested a 'NavigationContainer' inside another. Normally you need only one container at the root of the app, so this was probably an error. If this was intentional, pass 'independent={true}' explicitly. Note that this will make the child navigators disconnected from the parent and you won't be able to navigate between them.");const[E,w,P,I,j]=(0,h.default)((()=>O(null==b?void 0:b))),S=n.useRef(!0),M=n.useRef(),L=n.useCallback((()=>M.current),[]),N=n.useCallback((e=>{M.current=e}),[]),{listeners:A,addListener:D}=(0,f.default)(),{keyedListeners:G,addKeyedListener:K}=(0,v.default)(),T=n.useCallback((e=>{null==A.focus[0]?console.error(_r(d[18]).NOT_INITIALIZED_ERROR):A.focus[0]((t=>t.dispatch(e)))}),[A.focus]),U=n.useCallback((()=>{if(null==A.focus[0])return!1;const{result:e,handled:t}=A.focus[0]((e=>e.canGoBack()));return!!t&&e}),[A.focus]),x=n.useCallback((e=>{var t,n;const a=(null==e?void 0:e.key)??(null===(t=(n=G.getState).root)||void 0===t?void 0:t.call(n).key);null==a?console.error(_r(d[18]).NOT_INITIALIZED_ERROR):A.focus[0]((t=>t.dispatch(Object.assign({},_r(d[19]).CommonActions.reset(e),{target:a}))))}),[G.getState,A.focus]),W=n.useCallback((()=>{var e,t;return null===(e=(t=G.getState).root)||void 0===e?void 0:e.call(t)}),[G.getState]),B=n.useCallback((()=>{const e=W();if(null==e)return;return(0,r.default)(e)}),[W]),Z=(0,p.default)(),{addOptionsGetter:F,getCurrentOptions:H}=(0,y.default)({}),q=n.useMemo((()=>Object.assign({},Object.keys(_r(d[19]).CommonActions).reduce(((e,t)=>(e[t]=function(){return T(_r(d[19]).CommonActions[t](...arguments))},e)),{}),Z.create('root'),{dispatch:T,resetRoot:x,isFocused:()=>!0,canGoBack:U,getParent:()=>{},getState:()=>ae.current,getRootState:W,getCurrentRoute:B,getCurrentOptions:H,isReady:()=>null!=A.focus[0],setOptions:()=>{throw new Error('Cannot call setOptions outside a screen')}})),[U,T,Z,H,B,W,A.focus,x]);n.useImperativeHandle(t,(()=>q),[q]);const z=n.useCallback(((e,t)=>{Z.emit({type:'__unsafe_action__',data:{action:e,noop:t,stack:V.current}})}),[Z]),J=n.useRef(),Q=n.useCallback((e=>{J.current!==e&&(J.current=e,Z.emit({type:'options',data:{options:e}}))}),[Z]),V=n.useRef(),X=n.useMemo((()=>({addListener:D,addKeyedListener:K,onDispatchAction:z,onOptionsChange:Q,stackRef:V})),[D,K,z,Q]),Y=n.useMemo((()=>({scheduleUpdate:I,flushUpdates:j})),[I,j]),$=n.useRef(!0),ee=n.useCallback((()=>$.current),[]),te=n.useMemo((()=>({state:E,getState:w,setState:P,getKey:L,setKey:N,getIsInitial:ee,addOptionsGetter:F})),[E,w,P,L,N,ee,F]),ne=n.useRef(k),ae=n.useRef(E);n.useEffect((()=>{$.current=!1,ne.current=k,ae.current=E})),n.useEffect((()=>{const e=W();Z.emit({type:'state',data:{state:E}}),!S.current&&ne.current&&ne.current(e),S.current=!1}),[W,Z,E]);const re=n.useCallback((e=>{}),[]);let oe=n.createElement(u.default.Provider,{value:q},n.createElement(_r(d[20]).ScheduleUpdateContext.Provider,{value:Y},n.createElement(o.default.Provider,{value:X},n.createElement(c.default.Provider,{value:te},n.createElement(i.default.Provider,{value:C??re},n.createElement(a.default,null,_))))));return R&&(oe=n.createElement(l.default.Provider,{value:void 0},n.createElement(s.default.Provider,{value:void 0},oe))),oe}));_e.default=C}),145,[1,28,14,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,170]); -__d((function(g,r,i,a,m,e,d){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){const n=[],o=(t,u)=>{u.routes.forEach((u=>{var s,c;const l=t?`${t} > ${u.name}`:u.name;null===(s=u.state)||void 0===s||null===(c=s.routeNames)||void 0===c||c.forEach((t=>{t===u.name&&n.push([l,`${l} > ${u.name}`])})),u.state&&o(l,u.state)}))};return o('',t),n}}),146,[]); -__d((function(g,r,_i,a,m,e,d){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(n){return t(n,new Set,[])};const t=(n,i,o)=>{if(null==n||'boolean'==typeof n||'number'==typeof n||'string'==typeof n)return{serializable:!0};if('[object Object]'!==Object.prototype.toString.call(n)&&!Array.isArray(n))return{serializable:!1,location:o,reason:'function'==typeof n?'Function':String(n)};if(i.has(n))return{serializable:!1,reason:'Circular reference',location:o};if(i.add(n),Array.isArray(n))for(let l=0;l({register(e){const r=a.current;if(void 0!==r&&e!==r)throw new Error(t);a.current=e},unregister(e){e===a.current&&(a.current=void 0)}})),[]);return e.createElement(n.Provider,{value:i},o)};var e=(function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=r(t);if(n&&n.has(e))return n.get(e);var o={__proto__:null},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&{}.hasOwnProperty.call(e,i)){var u=a?Object.getOwnPropertyDescriptor(e,i):null;u&&(u.get||u.set)?Object.defineProperty(o,i,u):o[i]=e[i]}return o.default=e,n&&n.set(e,o),o})(_r(d[0]));function r(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(r=function(e){return e?n:t})(e)}const t="Another navigator is already registered for this container. You likely have multiple navigators under a single \"NavigationContainer\" or \"Screen\". Make sure each navigator is under a separate \"Screen\" container. See https://reactnavigation.org/docs/nesting-navigators for a guide on nesting.",n=_e.SingleNavigatorContext=e.createContext(void 0)}),148,[14]); -__d((function(g,r,i,a,m,e,d){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(o){var t,n;let u=o;for(;null!=(null===(l=u)||void 0===l?void 0:l.routes[u.index??0].state);){var l;u=u.routes[u.index??0].state}return null===(t=u)||void 0===t?void 0:t.routes[(null===(n=u)||void 0===n?void 0:n.index)??0]}}),149,[]); -__d((function(g,_r,_i,_a,m,_e,d){function e(t){if("function"!=typeof WeakMap)return null;var n=new WeakMap,r=new WeakMap;return(e=function(e){return e?r:n})(t)}Object.defineProperty(_e,"__esModule",{value:!0}),_e.default=void 0;const t=(function(t,n){if(!n&&t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var r=e(n);if(r&&r.has(t))return r.get(t);var o={__proto__:null},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in t)if("default"!==a&&{}.hasOwnProperty.call(t,a)){var f=u?Object.getOwnPropertyDescriptor(t,a):null;f&&(f.get||f.set)?Object.defineProperty(o,a,f):o[a]=t[a]}return o.default=t,r&&r.set(t,o),o})(_r(d[0])).createContext({onDispatchAction:()=>{},onOptionsChange:()=>{}});_e.default=t}),150,[14]); -__d((function(g,_r,_i,_a,m,_e,d){function e(t){if("function"!=typeof WeakMap)return null;var r=new WeakMap,n=new WeakMap;return(e=function(e){return e?n:r})(t)}Object.defineProperty(_e,"__esModule",{value:!0}),_e.default=void 0;const t=(function(t,r){if(!r&&t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var n=e(r);if(n&&n.has(t))return n.get(t);var o={__proto__:null},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var f in t)if("default"!==f&&{}.hasOwnProperty.call(t,f)){var a=u?Object.getOwnPropertyDescriptor(t,f):null;a&&(a.get||a.set)?Object.defineProperty(o,f,a):o[f]=t[f]}return o.default=t,n&&n.set(t,o),o})(_r(d[0])).createContext(void 0);_e.default=t}),151,[14]); -__d((function(g,_r,_i,_a,m,_e,d){function e(t){if("function"!=typeof WeakMap)return null;var r=new WeakMap,n=new WeakMap;return(e=function(e){return e?n:r})(t)}Object.defineProperty(_e,"__esModule",{value:!0}),_e.default=void 0;const t=(function(t,r){if(!r&&t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var n=e(r);if(n&&n.has(t))return n.get(t);var o={__proto__:null},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var f in t)if("default"!==f&&{}.hasOwnProperty.call(t,f)){var a=u?Object.getOwnPropertyDescriptor(t,f):null;a&&(a.get||a.set)?Object.defineProperty(o,f,a):o[f]=t[f]}return o.default=t,n&&n.set(t,o),o})(_r(d[0])).createContext(void 0);_e.default=t}),152,[14]); -__d((function(g,_r,_i,_a,m,_e,d){function e(t){if("function"!=typeof WeakMap)return null;var r=new WeakMap,n=new WeakMap;return(e=function(e){return e?n:r})(t)}Object.defineProperty(_e,"__esModule",{value:!0}),_e.default=void 0;const t=(function(t,r){if(!r&&t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var n=e(r);if(n&&n.has(t))return n.get(t);var o={__proto__:null},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var f in t)if("default"!==f&&{}.hasOwnProperty.call(t,f)){var a=u?Object.getOwnPropertyDescriptor(t,f):null;a&&(a.get||a.set)?Object.defineProperty(o,f,a):o[f]=t[f]}return o.default=t,n&&n.set(t,o),o})(_r(d[0])).createContext(void 0);_e.default=t}),153,[14]); -__d((function(g,_r,_i,_a,m,_e,d){Object.defineProperty(_e,"__esModule",{value:!0}),_e.default=void 0;var t=(function(t,r){if(!r&&t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var n=e(r);if(n&&n.has(t))return n.get(t);var o={__proto__:null},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in t)if("default"!==i&&{}.hasOwnProperty.call(t,i)){var u=a?Object.getOwnPropertyDescriptor(t,i):null;u&&(u.get||u.set)?Object.defineProperty(o,i,u):o[i]=t[i]}return o.default=t,n&&n.set(t,o),o})(_r(d[0]));function e(t){if("function"!=typeof WeakMap)return null;var r=new WeakMap,n=new WeakMap;return(e=function(t){return t?n:r})(t)}const r="Couldn't find a navigation context. Have you wrapped your app with 'NavigationContainer'? See https://reactnavigation.org/docs/getting-started for setup instructions.";_e.default=t.createContext({isDefault:!0,get getKey(){throw new Error(r)},get setKey(){throw new Error(r)},get getState(){throw new Error(r)},get setState(){throw new Error(r)},get getIsInitial(){throw new Error(r)}})}),154,[14]); -__d((function(g,_r,_i,_a,m,_e,d){function e(t){if("function"!=typeof WeakMap)return null;var r=new WeakMap,n=new WeakMap;return(e=function(e){return e?n:r})(t)}Object.defineProperty(_e,"__esModule",{value:!0}),_e.default=void 0;const t=(function(t,r){if(!r&&t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var n=e(r);if(n&&n.has(t))return n.get(t);var o={__proto__:null},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var f in t)if("default"!==f&&{}.hasOwnProperty.call(t,f)){var a=u?Object.getOwnPropertyDescriptor(t,f):null;a&&(a.get||a.set)?Object.defineProperty(o,f,a):o[f]=t[f]}return o.default=t,n&&n.set(t,o),o})(_r(d[0])).createContext(void 0);_e.default=t}),155,[14]); -__d((function(g,_r,_i,_a,m,_e,d){Object.defineProperty(_e,"__esModule",{value:!0}),_e.default=function(){const{current:t}=e.useRef({action:[],focus:[]}),r=e.useCallback(((e,r)=>{t[e].push(r);let n=!1;return()=>{const u=t[e].indexOf(r);!n&&u>-1&&(n=!0,t[e].splice(u,1))}}),[t]);return{listeners:t,addListener:r}};var e=(function(e,r){if(!r&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=t(r);if(n&&n.has(e))return n.get(e);var u={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var f in e)if("default"!==f&&{}.hasOwnProperty.call(e,f)){var a=o?Object.getOwnPropertyDescriptor(e,f):null;a&&(a.get||a.set)?Object.defineProperty(u,f,a):u[f]=e[f]}return u.default=e,n&&n.set(e,u),u})(_r(d[0]));function t(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap,n=new WeakMap;return(t=function(e){return e?n:r})(e)}}),156,[14]); -__d((function(g,_r,_i,_a,m,_e,d){Object.defineProperty(_e,"__esModule",{value:!0}),_e.default=function(t){const r=e.useRef(t);e.useEffect((()=>{r.current=t}));const n=e.useRef(Object.create(null)),u=e.useCallback((e=>{const t=(t,r)=>{const u=n.current[t]?n.current[t][e]:void 0;if(!u)return;const c=u.indexOf(r);c>-1&&u.splice(c,1)};return{addListener:(r,u)=>{n.current[r]=n.current[r]||{},n.current[r][e]=n.current[r][e]||[],n.current[r][e].push(u);let c=!1;return()=>{c||(c=!0,t(r,u))}},removeListener:t}}),[]),c=e.useCallback((e=>{var t,u;let{type:c,data:a,target:l,canPreventDefault:o}=e;const f=n.current[c]||{},i=void 0!==l?null===(t=f[l])||void 0===t?void 0:t.slice():[].concat(...Object.keys(f).map((e=>f[e]))).filter(((e,t,r)=>r.lastIndexOf(e)===t)),s={get type(){return c}};if(void 0!==l&&Object.defineProperty(s,'target',{enumerable:!0,get:()=>l}),void 0!==a&&Object.defineProperty(s,'data',{enumerable:!0,get:()=>a}),o){let e=!1;Object.defineProperties(s,{defaultPrevented:{enumerable:!0,get:()=>e},preventDefault:{enumerable:!0,value(){e=!0}}})}return null===(u=r.current)||void 0===u||u.call(r,s),null==i||i.forEach((e=>e(s))),s}),[]);return e.useMemo((()=>({create:u,emit:c})),[u,c])};var e=(function(e,r){if(!r&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=t(r);if(n&&n.has(e))return n.get(e);var u={__proto__:null},c=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&{}.hasOwnProperty.call(e,a)){var l=c?Object.getOwnPropertyDescriptor(e,a):null;l&&(l.get||l.set)?Object.defineProperty(u,a,l):u[a]=e[a]}return u.default=e,n&&n.set(e,u),u})(_r(d[0]));function t(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap,n=new WeakMap;return(t=function(e){return e?n:r})(e)}}),157,[14]); -__d((function(g,_r,_i,_a,m,_e,d){Object.defineProperty(_e,"__esModule",{value:!0}),_e.default=function(){const{current:t}=e.useRef(Object.assign(Object.create(null),{getState:{},beforeRemove:{}})),r=e.useCallback(((e,r,n)=>(t[e][r]=n,()=>{t[e][r]=void 0})),[t]);return{keyedListeners:t,addKeyedListener:r}};var e=(function(e,r){if(!r&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=t(r);if(n&&n.has(e))return n.get(e);var u={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&{}.hasOwnProperty.call(e,a)){var f=o?Object.getOwnPropertyDescriptor(e,a):null;f&&(f.get||f.set)?Object.defineProperty(u,a,f):u[a]=e[a]}return u.default=e,n&&n.set(e,u),u})(_r(d[0]));function t(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap,n=new WeakMap;return(t=function(e){return e?n:r})(e)}}),158,[14]); -__d((function(g,_r,_i,_a,m,_e,d){var e=_r(d[0]);Object.defineProperty(_e,"__esModule",{value:!0}),_e.default=function(e){let{key:u,options:l,navigation:o}=e;const c=t.useRef(l),a=t.useRef({}),{onOptionsChange:i}=t.useContext(n.default),{addOptionsGetter:f}=t.useContext(r.default),s=t.useCallback((()=>{const e=(null==o?void 0:o.isFocused())??!0,t=Object.keys(a.current).length;e&&!t&&i(c.current??{})}),[o,i]);t.useEffect((()=>(c.current=l,s(),null==o?void 0:o.addListener('focus',s))),[o,l,s]);const p=t.useCallback((()=>{for(let n in a.current)if(a.current.hasOwnProperty(n)){var e,t;const r=null===(e=(t=a.current)[n])||void 0===e?void 0:e.call(t);if(null!==r)return r}return null}),[]),v=t.useCallback((()=>{if(!((null==o?void 0:o.isFocused())??!0))return null;const e=p();return null!==e?e:c.current}),[o,p]);t.useEffect((()=>null==f?void 0:f(u,v)),[v,f,u]);return{addOptionsGetter:t.useCallback(((e,t)=>(a.current[e]=t,s(),()=>{delete a.current[e],s()})),[s]),getCurrentOptions:v}};var t=(function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=u(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&{}.hasOwnProperty.call(e,o)){var c=l?Object.getOwnPropertyDescriptor(e,o):null;c&&(c.get||c.set)?Object.defineProperty(r,o,c):r[o]=e[o]}return r.default=e,n&&n.set(e,r),r})(_r(d[1])),n=e(_r(d[2])),r=e(_r(d[3]));function u(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(u=function(e){return e?n:t})(e)}}),159,[1,14,150,154]); -__d((function(g,_r,_i,_a,m,_e,d){Object.defineProperty(_e,"__esModule",{value:!0}),_e.default=function(r){const n=e.useRef(t),u=e.useRef(!1),c=e.useRef(!0);e.useEffect((()=>(c.current=!0,()=>{c.current=!1})),[]),n.current===t&&(n.current='function'==typeof r?r():r);const[a,f]=e.useState(n.current),o=e.useCallback((()=>n.current),[]),l=e.useCallback((e=>{e!==n.current&&c.current&&(n.current=e,u.current||f(e))}),[]),s=e.useCallback((e=>{u.current=!0;try{e()}finally{u.current=!1}}),[]),i=e.useCallback((()=>{c.current&&f(n.current)}),[]);a!==n.current&&f(n.current);const p=n.current;return e.useDebugValue(p),[p,o,l,s,i]};var e=(function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=r(t);if(n&&n.has(e))return n.get(e);var u={__proto__:null},c=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&{}.hasOwnProperty.call(e,a)){var f=c?Object.getOwnPropertyDescriptor(e,a):null;f&&(f.get||f.set)?Object.defineProperty(u,a,f):u[a]=e[a]}return u.default=e,n&&n.set(e,u),u})(_r(d[0]));function r(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(r=function(e){return e?n:t})(e)}const t={}}),160,[14]); -__d((function(g,r,i,a,m,e,d){Object.defineProperty(e,"__esModule",{value:!0}),e.NOT_INITIALIZED_ERROR=void 0,e.default=function(){const n=[...Object.keys(r(d[0]).CommonActions),'addListener','removeListener','resetRoot','dispatch','isFocused','canGoBack','getRootState','getState','getParent','getCurrentRoute','getCurrentOptions'],o={},s=(t,n)=>{o[t]&&(o[t]=o[t].filter((t=>t!==n)))};let c=null;const u=Object.assign({get current(){return c},set current(t){c=t,null!=t&&Object.entries(o).forEach((n=>{let[o,s]=n;s.forEach((n=>{t.addListener(o,n)}))}))},isReady:()=>null!=c&&c.isReady()},n.reduce(((n,u)=>(n[u]=function(){for(var n=arguments.length,l=new Array(n),h=0;hs(t,n)}case'removeListener':{const[t,n]=l;s(t,n);break}default:console.error(t)}},n)),{}));return u};const t=e.NOT_INITIALIZED_ERROR="The 'navigation' object hasn't been initialized yet. This might happen if you don't have a navigator mounted, or if the navigator hasn't finished mounting. See https://reactnavigation.org/docs/navigating-without-navigation-prop#handling-initialization for more details."}),161,[162]); -__d((function(g,_r,_i,_a,m,_e,d){var e=_r(d[0]);Object.defineProperty(_e,"__esModule",{value:!0});var t={CommonActions:!0,BaseRouter:!0,DrawerActions:!0,DrawerRouter:!0,StackActions:!0,StackRouter:!0,TabActions:!0,TabRouter:!0};Object.defineProperty(_e,"BaseRouter",{enumerable:!0,get:function(){return n.default}}),_e.CommonActions=void 0,Object.defineProperty(_e,"DrawerActions",{enumerable:!0,get:function(){return o.DrawerActions}}),Object.defineProperty(_e,"DrawerRouter",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(_e,"StackActions",{enumerable:!0,get:function(){return u.StackActions}}),Object.defineProperty(_e,"StackRouter",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(_e,"TabActions",{enumerable:!0,get:function(){return a.TabActions}}),Object.defineProperty(_e,"TabRouter",{enumerable:!0,get:function(){return a.default}});var r=i(_r(d[1]));_e.CommonActions=r;var n=e(_r(d[2])),o=i(_r(d[3])),u=i(_r(d[4])),a=i(_r(d[5]));function c(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(c=function(e){return e?r:t})(e)}function i(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=c(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&{}.hasOwnProperty.call(e,u)){var a=o?Object.getOwnPropertyDescriptor(e,u):null;a&&(a.get||a.set)?Object.defineProperty(n,u,a):n[u]=e[u]}return n.default=e,r&&r.set(e,n),n}Object.keys(_r(d[6])).forEach((function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(t,e)||e in _e&&_e[e]===_r(d[6])[e]||Object.defineProperty(_e,e,{enumerable:!0,get:function(){return _r(d[6])[e]}}))}))}),162,[1,163,164,166,168,167,169]); -__d((function(g,r,i,a,m,e,d){Object.defineProperty(e,"__esModule",{value:!0}),e.goBack=function(){return{type:'GO_BACK'}},e.navigate=function(){if('string'==typeof(arguments.length<=0?void 0:arguments[0]))return{type:'NAVIGATE',payload:{name:arguments.length<=0?void 0:arguments[0],params:arguments.length<=1?void 0:arguments[1]}};{const t=(arguments.length<=0?void 0:arguments[0])||{};if(!t.hasOwnProperty('key')&&!t.hasOwnProperty('name'))throw new Error('You need to specify name or key when calling navigate with an object as the argument. See https://reactnavigation.org/docs/navigation-actions#navigate for usage.');return{type:'NAVIGATE',payload:t}}},e.reset=function(t){return{type:'RESET',payload:t}},e.setParams=function(t){return{type:'SET_PARAMS',payload:{params:t}}}}),163,[]); -__d((function(g,_r,_i,a,m,e,d){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;const s={getStateForAction(s,t){switch(t.type){case'SET_PARAMS':{const n=t.source?s.routes.findIndex((s=>s.key===t.source)):s.index;return-1===n?null:Object.assign({},s,{routes:s.routes.map(((s,o)=>o===n?Object.assign({},s,{params:Object.assign({},s.params,t.payload.params)}):s))})}case'RESET':{const n=t.payload;return 0===n.routes.length||n.routes.some((t=>!s.routeNames.includes(t.name)))?null:!1===n.stale?s.routeNames.length!==n.routeNames.length||n.routeNames.some((t=>!s.routeNames.includes(t)))?null:Object.assign({},n,{routes:n.routes.map((s=>s.key?s:Object.assign({},s,{key:`${s.name}-${(0,_r(d[0]).nanoid)()}`})))}):n}default:return null}},shouldActionChangeFocus:s=>'NAVIGATE'===s.type};e.default=s}),164,[165]); -__d((function(g,r,_i,a,m,e,d){Object.defineProperty(e,"__esModule",{value:!0}),e.nanoid=e.customAlphabet=void 0;e.customAlphabet=(t,n=21)=>(o=n)=>{let l='',u=o;for(;u--;)l+=t[Math.random()*t.length|0];return l};e.nanoid=(t=21)=>{let n='',o=t;for(;o--;)n+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return n}}),165,[]); -__d((function(g,_r,_i,_a,m,_e,d){var e=_r(d[0]);Object.defineProperty(_e,"__esModule",{value:!0}),_e.DrawerActions=void 0,_e.default=function(e){let{defaultStatus:o="closed"}=e,s=(0,t.default)(e,a);const u=(0,r.default)(s),i=e=>{var t;return Boolean(null===(t=e.history)||void 0===t?void 0:t.some((e=>'drawer'===e.type)))},c=e=>i(e)?e:Object.assign({},e,{history:[...e.history,{type:'drawer',status:'open'===o?'closed':'open'}]}),l=e=>i(e)?Object.assign({},e,{history:e.history.filter((e=>'drawer'!==e.type))}):e,f=e=>'open'===o?l(e):c(e),p=e=>'open'===o?c(e):l(e);return Object.assign({},u,{type:'drawer',getInitialState(e){let{routeNames:t,routeParamList:r,routeGetIdList:a}=e;const n=u.getInitialState({routeNames:t,routeParamList:r,routeGetIdList:a});return Object.assign({},n,{default:o,stale:!1,type:'drawer',key:`drawer-${(0,_r(d[3]).nanoid)()}`})},getRehydratedState(e,t){let{routeNames:r,routeParamList:a,routeGetIdList:n}=t;if(!1===e.stale)return e;let s=u.getRehydratedState(e,{routeNames:r,routeParamList:a,routeGetIdList:n});return i(e)&&(s=l(s),s=c(s)),Object.assign({},s,{default:o,type:'drawer',key:`drawer-${(0,_r(d[3]).nanoid)()}`})},getStateForRouteFocus(e,t){const r=u.getStateForRouteFocus(e,t);return p(r)},getStateForAction(e,t,r){switch(t.type){case'OPEN_DRAWER':return f(e);case'CLOSE_DRAWER':return p(e);case'TOGGLE_DRAWER':return i(e)?l(e):c(e);case'JUMP_TO':case'NAVIGATE':{const a=u.getStateForAction(e,t,r);return null!=a&&a.index!==e.index?p(a):a}case'GO_BACK':return i(e)?l(e):u.getStateForAction(e,t,r);default:return u.getStateForAction(e,t,r)}},actionCreators:n})};var t=e(_r(d[1])),r=(function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=o(t);if(r&&r.has(e))return r.get(e);var a={__proto__:null},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&{}.hasOwnProperty.call(e,s)){var u=n?Object.getOwnPropertyDescriptor(e,s):null;u&&(u.get||u.set)?Object.defineProperty(a,s,u):a[s]=e[s]}return a.default=e,r&&r.set(e,a),a})(_r(d[2]));const a=["defaultStatus"];function o(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(o=function(e){return e?r:t})(e)}const n=_e.DrawerActions=Object.assign({},r.TabActions,{openDrawer:()=>({type:'OPEN_DRAWER'}),closeDrawer:()=>({type:'CLOSE_DRAWER'}),toggleDrawer:()=>({type:'TOGGLE_DRAWER'})})}),166,[1,28,167,165]); -__d((function(g,_r,_i,a,m,e,d){var t=_r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.TabActions=void 0,e.default=function(t){let{initialRouteName:r,backBehavior:u="firstRoute"}=t;return Object.assign({},n.default,{type:'tab',getInitialState(t){let{routeNames:n,routeParamList:s}=t;const i=void 0!==r&&n.includes(r)?n.indexOf(r):0,y=n.map((t=>({name:t,key:`${t}-${(0,_r(d[2]).nanoid)()}`,params:s[t]}))),l=o(y,i,u,r);return{stale:!1,type:'tab',key:`tab-${(0,_r(d[2]).nanoid)()}`,index:i,routeNames:n,history:l,routes:y}},getRehydratedState(t,n){var s,o;let{routeNames:y,routeParamList:l}=n,p=t;if(!1===p.stale)return p;const c=y.map((t=>{const n=p.routes.find((n=>n.name===t));return Object.assign({},n,{name:t,key:n&&n.name===t&&n.key?n.key:`${t}-${(0,_r(d[2]).nanoid)()}`,params:void 0!==l[t]?Object.assign({},l[t],n?n.params:void 0):n?n.params:void 0})})),h=Math.min(Math.max(y.indexOf(null===(s=p.routes[(null==p?void 0:p.index)??0])||void 0===s?void 0:s.name),0),c.length-1),k=(null===(o=p.history)||void 0===o?void 0:o.filter((t=>c.find((n=>n.key===t.key)))))??[];return i({stale:!1,type:'tab',key:`tab-${(0,_r(d[2]).nanoid)()}`,index:h,routeNames:y,history:k,routes:c},h,u,r)},getStateForRouteNamesChange(t,n){let{routeNames:s,routeParamList:i,routeKeyChanges:y}=n;const l=s.map((n=>t.routes.find((t=>t.name===n&&!y.includes(t.name)))||{name:n,key:`${n}-${(0,_r(d[2]).nanoid)()}`,params:i[n]})),p=Math.max(0,s.indexOf(t.routes[t.index].name));let c=t.history.filter((t=>'route'!==t.type||l.find((n=>n.key===t.key))));return c.length||(c=o(l,p,u,r)),Object.assign({},t,{history:c,routeNames:s,routes:l,index:p})},getStateForRouteFocus(t,n){const s=t.routes.findIndex((t=>t.key===n));return-1===s||s===t.index?t:i(t,s,u,r)},getStateForAction(t,s,o){let{routeParamList:y,routeGetIdList:l}=o;switch(s.type){case'JUMP_TO':case'NAVIGATE':{let n=-1;return n='NAVIGATE'===s.type&&s.payload.key?t.routes.findIndex((t=>t.key===s.payload.key)):t.routes.findIndex((t=>t.name===s.payload.name)),-1===n?null:i(Object.assign({},t,{routes:t.routes.map(((t,r)=>{if(r!==n)return t;const o=l[t.name],i=null==o?void 0:o({params:t.params}),u=null==o?void 0:o({params:s.payload.params}),p=i===u?t.key:`${t.name}-${(0,_r(d[2]).nanoid)()}`;let c;c='NAVIGATE'===s.type&&s.payload.merge&&i===u?void 0!==s.payload.params||void 0!==y[t.name]?Object.assign({},y[t.name],t.params,s.payload.params):t.params:void 0!==y[t.name]?Object.assign({},y[t.name],s.payload.params):s.payload.params;const h='NAVIGATE'===s.type&&null!=s.payload.path?s.payload.path:t.path;return c!==t.params||h!==t.path?Object.assign({},t,{key:p,path:h,params:c}):t}))}),n,u,r)}case'GO_BACK':{if(1===t.history.length)return null;const n=t.history[t.history.length-2].key,r=t.routes.findIndex((t=>t.key===n));return-1===r?null:Object.assign({},t,{history:t.history.slice(0,-1),index:r})}default:return n.default.getStateForAction(t,s)}},shouldActionChangeFocus:t=>'NAVIGATE'===t.type,actionCreators:s})};var n=t(_r(d[1]));const r='route',s=e.TabActions={jumpTo:(t,n)=>({type:'JUMP_TO',payload:{name:t,params:n}})},o=(t,n,s,o)=>{const i=[{type:r,key:t[n].key}];let u;switch(s){case'order':for(let s=n;s>0;s--)i.unshift({type:r,key:t[s-1].key});break;case'firstRoute':0!==n&&i.unshift({type:r,key:t[0].key});break;case'initialRoute':u=t.findIndex((t=>t.name===o)),u=-1===u?0:u,n!==u&&i.unshift({type:r,key:t[u].key})}return i},i=(t,n,s,i)=>{let u;if('history'===s){const s=t.routes[n].key;u=t.history.filter((t=>'route'===t.type&&t.key!==s)).concat({type:r,key:s})}else u=o(t.routes,n,s,i);return Object.assign({},t,{index:n,history:u})}}),167,[1,164,165]); -__d((function(g,_r,_i,a,m,e,d){var t=_r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.StackActions=void 0,e.default=function(t){const s=Object.assign({},n.default,{type:'stack',getInitialState(n){let{routeNames:o,routeParamList:s}=n;const r=void 0!==t.initialRouteName&&o.includes(t.initialRouteName)?t.initialRouteName:o[0];return{stale:!1,type:'stack',key:`stack-${(0,_r(d[2]).nanoid)()}`,index:0,routeNames:o,routes:[{key:`${r}-${(0,_r(d[2]).nanoid)()}`,name:r,params:s[r]}]}},getRehydratedState(n,o){let{routeNames:s,routeParamList:r}=o,i=n;if(!1===i.stale)return i;const l=i.routes.filter((t=>s.includes(t.name))).map((t=>Object.assign({},t,{key:t.key||`${t.name}-${(0,_r(d[2]).nanoid)()}`,params:void 0!==r[t.name]?Object.assign({},r[t.name],t.params):t.params})));if(0===l.length){const n=void 0!==t.initialRouteName?t.initialRouteName:s[0];l.push({key:`${n}-${(0,_r(d[2]).nanoid)()}`,name:n,params:r[n]})}return{stale:!1,type:'stack',key:`stack-${(0,_r(d[2]).nanoid)()}`,index:l.length-1,routeNames:s,routes:l}},getStateForRouteNamesChange(n,o){let{routeNames:s,routeParamList:r,routeKeyChanges:i}=o;const l=n.routes.filter((t=>s.includes(t.name)&&!i.includes(t.name)));if(0===l.length){const n=void 0!==t.initialRouteName&&s.includes(t.initialRouteName)?t.initialRouteName:s[0];l.push({key:`${n}-${(0,_r(d[2]).nanoid)()}`,name:n,params:r[n]})}return Object.assign({},n,{routeNames:s,routes:l,index:Math.min(n.index,l.length-1)})},getStateForRouteFocus(t,n){const o=t.routes.findIndex((t=>t.key===n));return-1===o||o===t.index?t:Object.assign({},t,{index:o,routes:t.routes.slice(0,o+1)})},getStateForAction(t,o,r){const{routeParamList:i}=r;switch(o.type){case'REPLACE':{const n=o.target===t.key&&o.source?t.routes.findIndex((t=>t.key===o.source)):t.index;if(-1===n)return null;const{name:s,key:r,params:l}=o.payload;return t.routeNames.includes(s)?Object.assign({},t,{routes:t.routes.map(((t,o)=>o===n?{key:void 0!==r?r:`${s}-${(0,_r(d[2]).nanoid)()}`,name:s,params:void 0!==i[s]?Object.assign({},i[s],l):l}:t))}):null}case'PUSH':if(t.routeNames.includes(o.payload.name)){const n=r.routeGetIdList[o.payload.name],s=null==n?void 0:n({params:o.payload.params}),l=s?t.routes.find((t=>t.name===o.payload.name&&s===(null==n?void 0:n({params:t.params})))):void 0;let u;return l?(u=t.routes.filter((t=>t.key!==l.key)),u.push(Object.assign({},l,{params:void 0!==i[o.payload.name]?Object.assign({},i[o.payload.name],o.payload.params):o.payload.params}))):u=[...t.routes,{key:`${o.payload.name}-${(0,_r(d[2]).nanoid)()}`,name:o.payload.name,params:void 0!==i[o.payload.name]?Object.assign({},i[o.payload.name],o.payload.params):o.payload.params}],Object.assign({},t,{index:u.length-1,routes:u})}return null;case'POP':{const n=o.target===t.key&&o.source?t.routes.findIndex((t=>t.key===o.source)):t.index;if(n>0){const s=Math.max(n-o.payload.count+1,1),r=t.routes.slice(0,s).concat(t.routes.slice(n+1));return Object.assign({},t,{index:r.length-1,routes:r})}return null}case'POP_TO_TOP':return s.getStateForAction(t,{type:'POP',payload:{count:t.routes.length-1}},r);case'NAVIGATE':if(void 0!==o.payload.name&&!t.routeNames.includes(o.payload.name))return null;if(o.payload.key||o.payload.name){let n=-1;const s=void 0===o.payload.key&&void 0!==o.payload.name?r.routeGetIdList[o.payload.name]:void 0,l=null==s?void 0:s({params:o.payload.params});if(l)n=t.routes.findIndex((t=>t.name===o.payload.name&&l===(null==s?void 0:s({params:t.params}))));else if(t.routes[t.index].name===o.payload.name&&void 0===o.payload.key||t.routes[t.index].key===o.payload.key)n=t.index;else for(let s=t.routes.length-1;s>=0;s--)if(t.routes[s].name===o.payload.name&&void 0===o.payload.key||t.routes[s].key===o.payload.key){n=s;break}if(-1===n&&o.payload.key&&void 0===o.payload.name)return null;if(-1===n&&void 0!==o.payload.name){const n=[...t.routes,{key:o.payload.key??`${o.payload.name}-${(0,_r(d[2]).nanoid)()}`,name:o.payload.name,path:o.payload.path,params:void 0!==i[o.payload.name]?Object.assign({},i[o.payload.name],o.payload.params):o.payload.params}];return Object.assign({},t,{routes:n,index:n.length-1})}const u=t.routes[n];let p;return p=o.payload.merge?void 0!==o.payload.params||void 0!==i[u.name]?Object.assign({},i[u.name],u.params,o.payload.params):u.params:void 0!==i[u.name]?Object.assign({},i[u.name],o.payload.params):o.payload.params,Object.assign({},t,{index:n,routes:[...t.routes.slice(0,n),p!==u.params||o.payload.path&&o.payload.path!==u.path?Object.assign({},u,{path:o.payload.path??u.path,params:p}):t.routes[n]]})}return null;case'GO_BACK':return t.index>0?s.getStateForAction(t,{type:'POP',payload:{count:1},target:o.target,source:o.source},r):null;default:return n.default.getStateForAction(t,o)}},actionCreators:o});return s};var n=t(_r(d[1]));const o=e.StackActions={replace:(t,n)=>({type:'REPLACE',payload:{name:t,params:n}}),push:(t,n)=>({type:'PUSH',payload:{name:t,params:n}}),pop(){return{type:'POP',payload:{count:arguments.length>0&&void 0!==arguments[0]?arguments[0]:1}}},popToTop:()=>({type:'POP_TO_TOP'})}}),168,[1,164,165]); -__d((function(g,r,i,a,m,e,d){Object.defineProperty(e,"__esModule",{value:!0})}),169,[]); -__d((function(g,_r,_i,_a,m,_e,d){Object.defineProperty(_e,"__esModule",{value:!0}),_e.ScheduleUpdateContext=void 0,_e.default=function(t){const{scheduleUpdate:r,flushUpdates:o}=e.useContext(n);r(t),e.useEffect(o)};var e=(function(e,r){if(!r&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=t(r);if(n&&n.has(e))return n.get(e);var o={__proto__:null},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&{}.hasOwnProperty.call(e,a)){var f=u?Object.getOwnPropertyDescriptor(e,a):null;f&&(f.get||f.set)?Object.defineProperty(o,a,f):o[a]=e[a]}return o.default=e,n&&n.set(e,o),o})(_r(d[0]));function t(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap,n=new WeakMap;return(t=function(e){return e?n:r})(e)}const r="Couldn't find a schedule context.",n=_e.ScheduleUpdateContext=e.createContext({scheduleUpdate(){throw new Error(r)},flushUpdates(){throw new Error(r)}})}),170,[14]); -__d((function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){return function(){if(void 0!==arguments[0])throw new Error("Creating a navigator doesn't take an argument. Maybe you are trying to use React Navigation 4 API? See https://reactnavigation.org/docs/hello-react-navigation for the latest API and guides.");return{Navigator:t,Group:n.default,Screen:o.default}}};var n=t(r(d[1])),o=t(r(d[2]))}),171,[1,172,173]); -__d((function(g,r,i,a,m,e,d){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(n){return null}}),172,[]); -__d((function(g,r,i,a,m,e,d){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(n){return null}}),173,[]); -__d((function(g,_r,_i,_a,m,_e,d){function e(t){if("function"!=typeof WeakMap)return null;var r=new WeakMap,n=new WeakMap;return(e=function(e){return e?n:r})(t)}Object.defineProperty(_e,"__esModule",{value:!0}),_e.default=void 0;const t=(function(t,r){if(!r&&t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var n=e(r);if(n&&n.has(t))return n.get(t);var o={__proto__:null},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var f in t)if("default"!==f&&{}.hasOwnProperty.call(t,f)){var a=u?Object.getOwnPropertyDescriptor(t,f):null;a&&(a.get||a.set)?Object.defineProperty(o,f,a):o[f]=t[f]}return o.default=t,n&&n.set(t,o),o})(_r(d[0])).createContext(void 0);_e.default=t}),174,[14]); -__d((function(g,r,i,a,m,e,d){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,l){var s;const o=l?n(l):{},u=null!=t.index?t.routes.slice(0,t.index+1):t.routes;if(0===u.length)return;if(!(1===u.length&&void 0===u[0].key||2===u.length&&void 0===u[0].key&&u[0].name===(null==o?void 0:o.initialRouteName)&&void 0===u[1].key))return{type:'RESET',payload:t};const v=t.routes[t.index??t.routes.length-1];let c=null==v?void 0:v.state,p=null==o||null===(s=o.screens)||void 0===s?void 0:s[null==v?void 0:v.name],f=Object.assign({},v.params),h=v?{name:v.name,path:v.path,params:f}:void 0;for(;c;){var y,b,k;if(0===c.routes.length)return;const n=null!=c.index?c.routes.slice(0,c.index+1):c.routes,t=n[n.length-1];if(Object.assign(f,{initial:void 0,screen:void 0,params:void 0,state:void 0}),1===n.length&&void 0===n[0].key)f.initial=!0,f.screen=t.name;else{if(2!==n.length||void 0!==n[0].key||n[0].name!==(null===(y=p)||void 0===y?void 0:y.initialRouteName)||void 0!==n[1].key){f.state=c;break}f.initial=!1,f.screen=t.name}t.state?(f.params=Object.assign({},t.params),f=f.params):(f.path=t.path,f.params=t.params),c=t.state,p=null===(b=p)||void 0===b||null===(k=b.screens)||void 0===k?void 0:k[t.name]}if(!h)return;return{type:'NAVIGATE',payload:h}};const n=n=>'object'==typeof n&&null!=n?{initialRouteName:n.initialRouteName,screens:null!=n.screens?t(n.screens):void 0}:{},t=t=>Object.entries(t).reduce(((t,l)=>{let[s,o]=l;return t[s]=n(o),t}),{})}),175,[]); -__d((function(g,r,i,a,m,e,d){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){const n=t[r(d[0]).CHILD_STATE]??t.state,o=t.params;return n?n.routes[n.index??('string'==typeof n.type&&'stack'!==n.type?0:n.routes.length-1)].name:'string'==typeof(null==o?void 0:o.screen)?o.screen:void 0}}),176,[177]); -__d((function(g,_r,_i,_a,m,_e,d){var e=_r(d[0]);Object.defineProperty(_e,"__esModule",{value:!0}),_e.CHILD_STATE=void 0,_e.default=function(e){t.useMemo((()=>({current:new Map})),[]);return e};e(_r(d[1]));var t=(function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=r(t);if(n&&n.has(e))return n.get(e);var u={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var f in e)if("default"!==f&&{}.hasOwnProperty.call(e,f)){var a=o?Object.getOwnPropertyDescriptor(e,f):null;a&&(a.get||a.set)?Object.defineProperty(u,f,a):u[f]=e[f]}return u.default=e,n&&n.set(e,u),u})(_r(d[2]));function r(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(r=function(e){return e?n:t})(e)}_e.CHILD_STATE=Symbol('CHILD_STATE')}),177,[1,28,14]); -__d((function(g,_r,_i,_a,m,_e,d){var e=_r(d[0]);Object.defineProperty(_e,"__esModule",{value:!0}),_e.default=function(e,o){if(null==e)throw Error("Got 'undefined' for the navigation state. You must pass a valid state object.");o&&(0,r.default)(o);const s=null!=o&&o.screens?u(null==o?void 0:o.screens):{};let l='/',f=e;const c={};for(;f;){let r,o,u='number'==typeof f.index?f.index:0,h=f.routes[u],y=i(e),b=s,j=[],O=!0;for(;h.name in b&&O;){if(r=b[h.name].pattern,j.push(h.name),h.params){var p;const e=null===(p=b[h.name])||void 0===p?void 0:p.stringify,t=(0,n.default)(Object.entries(h.params).map((t=>{let[n,r]=t;return[n,null!=e&&e[n]?e[n](r):String(r)]})));var v;if(r&&Object.assign(c,t),y===h)o=Object.assign({},t),null===(v=r)||void 0===v||v.split('/').filter((e=>e.startsWith(':'))).forEach((e=>{const t=a(e);o&&delete o[t]}))}if(b[h.name].screens&&void 0!==h.state){u='number'==typeof h.state.index?h.state.index:h.state.routes.length-1;const e=h.state.routes[u],t=b[h.name].screens;t&&e.name in t?(h=e,b=t):O=!1}else O=!1}if(void 0===r&&(r=j.join('/')),void 0!==b[h.name]?l+=r.split('/').map((e=>{const t=a(e);if('*'===e)return h.name;if(e.startsWith(':')){const n=c[t];return void 0===n&&e.endsWith('?')?'':encodeURIComponent(n)}return encodeURIComponent(e)})).join('/'):l+=encodeURIComponent(h.name),o||(o=y.params),h.state)l+='/';else if(o){for(let e in o)'undefined'===o[e]&&delete o[e];const e=t.stringify(o,{sort:!1});e&&(l+=`?${e}`)}f=h.state}return l=l.replace(/\/+/g,'/'),l=l.length>1?l.replace(/\/$/,''):l,l};var t=(function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=o(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&{}.hasOwnProperty.call(e,a)){var s=i?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(r,a,s):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r})(_r(d[1])),n=e(_r(d[2])),r=e(_r(d[3]));function o(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(o=function(e){return e?n:t})(e)}const i=e=>{const t='number'==typeof e.index?e.routes[e.index]:e.routes[e.routes.length-1];return t.state?i(t.state):t};const a=e=>e.replace(/^:/,'').replace(/\?$/,''),s=function(){for(var e=arguments.length,t=new Array(e),n=0;ne.split('/')))).filter(Boolean).join('/')},l=(e,t)=>{var n;if('string'==typeof e){return{pattern:t?s(t,e):e}}let r;if(e.exact&&void 0===e.path)throw new Error("A 'path' needs to be specified when specifying 'exact: true'. If you don't want this screen in the URL, specify it as empty string, e.g. `path: ''`.");r=!0!==e.exact?s(t||'',e.path||''):e.path||'';const o=e.screens?u(e.screens,r):void 0;return{pattern:null===(n=r)||void 0===n?void 0:n.split('/').filter(Boolean).join('/'),stringify:e.stringify,screens:o}},u=(e,t)=>(0,n.default)(Object.entries(e).map((e=>{let[n,r]=e;return[n,l(r,t)]})))}),178,[1,179,184,185]); -__d((function(g,r,i,_a,m,e,d){'use strict';const t=Symbol('encodeFragmentIdentifier');function n(t){switch(t.arrayFormat){case'index':return n=>(a,o)=>{const c=a.length;return void 0===o||t.skipNull&&null===o||t.skipEmptyString&&''===o?a:null===o?[...a,[s(n,t),'[',c,']'].join('')]:[...a,[s(n,t),'[',s(c,t),']=',s(o,t)].join('')]};case'bracket':return n=>(a,o)=>void 0===o||t.skipNull&&null===o||t.skipEmptyString&&''===o?a:null===o?[...a,[s(n,t),'[]'].join('')]:[...a,[s(n,t),'[]=',s(o,t)].join('')];case'colon-list-separator':return n=>(a,o)=>void 0===o||t.skipNull&&null===o||t.skipEmptyString&&''===o?a:null===o?[...a,[s(n,t),':list='].join('')]:[...a,[s(n,t),':list=',s(o,t)].join('')];case'comma':case'separator':case'bracket-separator':{const n='bracket-separator'===t.arrayFormat?'[]=':'=';return a=>(o,c)=>void 0===c||t.skipNull&&null===c||t.skipEmptyString&&''===c?o:(c=null===c?'':c,0===o.length?[[s(a,t),n,s(c,t)].join('')]:[[o,s(c,t)].join(t.arrayFormatSeparator)])}default:return n=>(a,o)=>void 0===o||t.skipNull&&null===o||t.skipEmptyString&&''===o?a:null===o?[...a,s(n,t)]:[...a,[s(n,t),'=',s(o,t)].join('')]}}function a(t){let n;switch(t.arrayFormat){case'index':return(t,a,o)=>{n=/\[(\d*)\]$/.exec(t),t=t.replace(/\[\d*\]$/,''),n?(void 0===o[t]&&(o[t]={}),o[t][n[1]]=a):o[t]=a};case'bracket':return(t,a,o)=>{n=/(\[\])$/.exec(t),t=t.replace(/\[\]$/,''),n?void 0!==o[t]?o[t]=[].concat(o[t],a):o[t]=[a]:o[t]=a};case'colon-list-separator':return(t,a,o)=>{n=/(:list)$/.exec(t),t=t.replace(/:list$/,''),n?void 0!==o[t]?o[t]=[].concat(o[t],a):o[t]=[a]:o[t]=a};case'comma':case'separator':return(n,a,o)=>{const s='string'==typeof a&&a.includes(t.arrayFormatSeparator),l='string'==typeof a&&!s&&c(a,t).includes(t.arrayFormatSeparator);a=l?c(a,t):a;const u=s||l?a.split(t.arrayFormatSeparator).map((n=>c(n,t))):null===a?a:c(a,t);o[n]=u};case'bracket-separator':return(n,a,o)=>{const s=/(\[\])$/.test(n);if(n=n.replace(/\[\]$/,''),!s)return void(o[n]=a?c(a,t):a);const l=null===a?[]:a.split(t.arrayFormatSeparator).map((n=>c(n,t)));void 0!==o[n]?o[n]=[].concat(o[n],l):o[n]=l};default:return(t,n,a)=>{void 0!==a[t]?a[t]=[].concat(a[t],n):a[t]=n}}}function o(t){if('string'!=typeof t||1!==t.length)throw new TypeError('arrayFormatSeparator must be single character string')}function s(t,n){return n.encode?n.strict?r(d[0])(t):encodeURIComponent(t):t}function c(t,n){return n.decode?r(d[1])(t):t}function l(t){return Array.isArray(t)?t.sort():'object'==typeof t?l(Object.keys(t)).sort(((t,n)=>Number(t)-Number(n))).map((n=>t[n])):t}function u(t){const n=t.indexOf('#');return-1!==n&&(t=t.slice(0,n)),t}function p(t){let n='';const a=t.indexOf('#');return-1!==a&&(n=t.slice(a)),n}function f(t){const n=(t=u(t)).indexOf('?');return-1===n?'':t.slice(n+1)}function y(t,n){return n.parseNumbers&&!Number.isNaN(Number(t))&&'string'==typeof t&&''!==t.trim()?t=Number(t):!n.parseBooleans||null===t||'true'!==t.toLowerCase()&&'false'!==t.toLowerCase()||(t='true'===t.toLowerCase()),t}function b(t,n){o((n=Object.assign({decode:!0,sort:!0,arrayFormat:'none',arrayFormatSeparator:',',parseNumbers:!1,parseBooleans:!1},n)).arrayFormatSeparator);const s=a(n),u=Object.create(null);if('string'!=typeof t)return u;if(!(t=t.trim().replace(/^[?#&]/,'')))return u;for(const a of t.split('&')){if(''===a)continue;let[t,o]=r(d[2])(n.decode?a.replace(/\+/g,' '):a,'=');o=void 0===o?null:['comma','separator','bracket-separator'].includes(n.arrayFormat)?o:c(o,n),s(c(t,n),o,u)}for(const t of Object.keys(u)){const a=u[t];if('object'==typeof a&&null!==a)for(const t of Object.keys(a))a[t]=y(a[t],n);else u[t]=y(a,n)}return!1===n.sort?u:(!0===n.sort?Object.keys(u).sort():Object.keys(u).sort(n.sort)).reduce(((t,n)=>{const a=u[n];return Boolean(a)&&'object'==typeof a&&!Array.isArray(a)?t[n]=l(a):t[n]=a,t}),Object.create(null))}e.extract=f,e.parse=b,e.stringify=(t,a)=>{if(!t)return'';o((a=Object.assign({encode:!0,strict:!0,arrayFormat:'none',arrayFormatSeparator:','},a)).arrayFormatSeparator);const c=n=>a.skipNull&&null==t[n]||a.skipEmptyString&&''===t[n],l=n(a),u={};for(const n of Object.keys(t))c(n)||(u[n]=t[n]);const p=Object.keys(u);return!1!==a.sort&&p.sort(a.sort),p.map((n=>{const o=t[n];return void 0===o?'':null===o?s(n,a):Array.isArray(o)?0===o.length&&'bracket-separator'===a.arrayFormat?s(n,a)+'[]':o.reduce(l(n),[]).join('&'):s(n,a)+'='+s(o,a)})).filter((t=>t.length>0)).join('&')},e.parseUrl=(t,n)=>{n=Object.assign({decode:!0},n);const[a,o]=r(d[2])(t,'#');return Object.assign({url:a.split('?')[0]||'',query:b(f(t),n)},n&&n.parseFragmentIdentifier&&o?{fragmentIdentifier:c(o,n)}:{})},e.stringifyUrl=(n,a)=>{a=Object.assign({encode:!0,strict:!0,[t]:!0},a);const o=u(n.url).split('?')[0]||'',c=e.extract(n.url),l=e.parse(c,{sort:!1}),f=Object.assign(l,n.query);let y=e.stringify(f,a);y&&(y=`?${y}`);let b=p(n.url);return n.fragmentIdentifier&&(b=`#${a[t]?s(n.fragmentIdentifier,a):n.fragmentIdentifier}`),`${o}${y}${b}`},e.pick=(n,a,o)=>{o=Object.assign({parseFragmentIdentifier:!0,[t]:!1},o);const{url:s,query:c,fragmentIdentifier:l}=e.parseUrl(n,o);return e.stringifyUrl({url:s,query:r(d[3])(c,a),fragmentIdentifier:l},o)},e.exclude=(t,n,a)=>{const o=Array.isArray(n)?t=>!n.includes(t):(t,a)=>!n(t,a);return e.pick(t,o,a)}}),179,[180,181,182,183]); -__d((function(g,r,i,a,m,e,d){'use strict';m.exports=t=>encodeURIComponent(t).replace(/[!'()*]/g,(t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`))}),180,[]); -__d((function(g,r,_i,a,m,e,d){'use strict';var t=new RegExp("(%[a-f0-9]{2})|([^%]+?)",'gi'),n=new RegExp("(%[a-f0-9]{2})+",'gi');function o(t,n){try{return[decodeURIComponent(t.join(''))]}catch(t){}if(1===t.length)return t;n=n||1;var c=t.slice(0,n),p=t.slice(n);return Array.prototype.concat.call([],o(c),o(p))}function c(n){try{return decodeURIComponent(n)}catch(i){for(var c=n.match(t)||[],p=1;p{if('string'!=typeof t||'string'!=typeof n)throw new TypeError('Expected the arguments to be of type `string`');if(''===n)return[t];const s=t.indexOf(n);return-1===s?[t]:[t.slice(0,s),t.slice(s+n.length)]}}),182,[]); -__d((function(g,r,_i,a,m,e,d){'use strict';m.exports=function(t,n){for(var i={},s=Object.keys(t),c=Array.isArray(n),f=0;f{let[o,u]=n;if(t.hasOwnProperty(o))throw new Error(`A value for key '${o}' already exists in the object.`);return t[o]=u,t}),{})}}),184,[]); -__d((function(g,r,i,a,m,e,d){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function t(o){let s=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const c=['initialRouteName','screens'];s||c.push('path','exact','stringify','parse');const f=Object.keys(o).filter((n=>!c.includes(n)));if(f.length)throw new Error(`Found invalid properties in the configuration:\n${n(f)}\n\nDid you forget to specify them under a 'screens' property?\n\nYou can only specify the following properties:\n${n(c)}\n\nSee https://reactnavigation.org/docs/configuring-links for more details on how to specify a linking configuration.`);o.screens&&Object.entries(o.screens).forEach((n=>{let[o,s]=n;'string'!=typeof s&&t(s,!1)}))};const n=n=>n.map((n=>`- ${n}`)).join('\n')}),185,[]); -__d((function(g,_r,_i,_a,m,_e,d){var e=_r(d[0]);Object.defineProperty(_e,"__esModule",{value:!0}),_e.default=function(e,t){t&&(0,a.default)(t);let n=[];null!=t&&t.initialRouteName&&n.push({initialRouteName:t.initialRouteName,parentScreens:[]});const r=null==t?void 0:t.screens;let o=e.replace(/\/+/g,'/').replace(/^\//,'').replace(/\?.*$/,'');if(o=o.endsWith('/')?o:`${o}/`,void 0===r){const t=o.split('/').filter(Boolean).map((e=>({name:decodeURIComponent(e)})));return t.length?h(e,t,n):void 0}const s=[].concat(...Object.keys(r).map((e=>l(e,r,[],n,[])))).sort(((e,t)=>{if(e.pattern===t.pattern)return t.routeNames.join('>').localeCompare(e.routeNames.join('>'));if(e.pattern.startsWith(t.pattern))return-1;if(t.pattern.startsWith(e.pattern))return 1;const n=e.pattern.split('/'),r=t.pattern.split('/');for(let e=0;e{if(e[t.pattern]){const n=e[t.pattern].routeNames,r=t.routeNames;if(!(n.length>r.length?r.every(((e,t)=>n[t]===e)):n.every(((e,t)=>r[t]===e))))throw new Error(`Found conflicting screens with the same pattern. The pattern '${t.pattern}' resolves to both '${n.join(' > ')}' and '${r.join(' > ')}'. Patterns must be unique and cannot resolve to more than one screen.`)}return Object.assign(e,{[t.pattern]:t})}),{}),'/'===o){const t=s.find((e=>''===e.path&&e.routeNames.every((e=>{var t;return!(null!==(t=s.find((t=>t.screen===e)))&&void 0!==t&&t.path)}))));return t?h(e,t.routeNames.map((e=>({name:e}))),n,s):void 0}let u,p;const{routes:c,remainingPath:f}=i(o,s.map((e=>Object.assign({},e,{regex:e.regex?new RegExp(e.regex.source+'$'):void 0}))));void 0!==c&&(p=h(e,c,n,s),o=f,u=p);if(null==p||null==u)return;return u};var t=e(_r(d[1])),n=(function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=o(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&{}.hasOwnProperty.call(e,s)){var i=a?Object.getOwnPropertyDescriptor(e,s):null;i&&(i.get||i.set)?Object.defineProperty(r,s,i):r[s]=e[s]}return r.default=e,n&&n.set(e,r),r})(_r(d[2])),r=e(_r(d[3])),a=e(_r(d[4]));function o(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(o=function(e){return e?n:t})(e)}const s=function(){for(var e=arguments.length,t=new Array(e),n=0;ne.split('/')))).filter(Boolean).join('/')},i=(e,n)=>{let r,a=e;for(const e of n){if(!e.regex)continue;const s=a.match(e.regex);if(s){var o;const i=(null===(o=e.pattern)||void 0===o?void 0:o.split('/').reduce(((e,t,n)=>{if(!t.startsWith(':'))return e;e.pos+=1;const r=decodeURIComponent(s[2*(e.pos+1)].replace(/\/$/,''));return Object.assign(e.matchedParams,{[t]:Object.assign(e.matchedParams[t]||{},{[n]:r})}),e}),{pos:-1,matchedParams:{}})).matchedParams||{};r=e.routeNames.map((r=>{var a;const o=n.find((t=>t.screen===r&&e.pattern.startsWith(t.pattern))),s=null==o?void 0:o.path.split('/').filter(Boolean).join('/'),l=null==o||null===(a=o.pattern.replace(new RegExp(`${(0,t.default)(s)}$`),''))||void 0===a?void 0:a.split('/').length,u=null==s?void 0:s.split('/').reduce(((e,t,n)=>{var r;if(!t.startsWith(':'))return e;const a=l?l-1:0,s=null===(r=i[t])||void 0===r?void 0:r[n+a];if(s){var u;const n=t.replace(/^:/,'').replace(/\?$/,'');e[n]=null!=o&&null!==(u=o.parse)&&void 0!==u&&u[n]?o.parse[n](s):s}return e}),{});return u&&Object.keys(u).length?{name:r,params:u}:{name:r}})),a=a.replace(s[1],'');break}}return{routes:r,remainingPath:a}},l=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=arguments.length>3?arguments[3]:void 0,a=arguments.length>4?arguments[4]:void 0,o=arguments.length>5?arguments[5]:void 0;const i=[];n.push(e),a.push(e);const p=t[e];if('string'==typeof p){const t=o?s(o,p):p;i.push(u(e,n,t,p))}else if('object'==typeof p){let t;if('string'==typeof p.path){if(p.exact&&void 0===p.path)throw new Error("A 'path' needs to be specified when specifying 'exact: true'. If you don't want this screen in the URL, specify it as empty string, e.g. `path: ''`.");t=!0!==p.exact?s(o||'',p.path||''):p.path||'',i.push(u(e,n,t,p.path,p.parse))}p.screens&&(p.initialRouteName&&r.push({initialRouteName:p.initialRouteName,parentScreens:a}),Object.keys(p.screens).forEach((e=>{const s=l(e,p.screens,n,r,[...a],t??o);i.push(...s)})))}return n.pop(),i},u=(e,n,r,a,o)=>({screen:e,regex:(r=r.split('/').filter(Boolean).join('/'))?new RegExp(`^(${r.split('/').map((e=>e.startsWith(':')?`(([^/]+\\/)${e.endsWith('?')?'?':''})`:`${'*'===e?'.*':(0,t.default)(e)}\\/`)).join('')})`):void 0,pattern:r,path:a,routeNames:[...n],parse:o}),p=(e,t)=>{for(const n of t)if(e===n.routeNames[n.routeNames.length-1])return n.parse},c=(e,t,n)=>{for(const r of n)if(t.length===r.parentScreens.length){let n=!0;for(let e=0;en?e?{index:1,routes:[{name:e},t]}:{routes:[t]}:e?{index:1,routes:[{name:e},Object.assign({},t,{state:{routes:[]}})]}:{routes:[Object.assign({},t,{state:{routes:[]}})]},h=(e,t,n,a)=>{let o,s=t.shift();const i=[];let l=c(s.name,i,n);if(i.push(s.name),o=f(l,s,0===t.length),t.length>0){let e=o;for(;s=t.shift();){l=c(s.name,i,n);const r=e.index||e.routes.length-1;e.routes[r].state=f(l,s,0===t.length),t.length>0&&(e=e.routes[r].state),i.push(s.name)}}s=(0,r.default)(o),s.path=e;const u=v(e,a?p(s.name,a):void 0);return u&&(s.params=Object.assign({},s.params,u)),o},v=(e,t)=>{const r=e.split('?')[1],a=n.parse(r);return t&&Object.keys(a).forEach((e=>{Object.hasOwnProperty.call(t,e)&&'string'==typeof a[e]&&(a[e]=t[e](a[e]))})),Object.keys(a).length?a:void 0}}),186,[1,187,179,149,185]); -__d((function(g,r,i,a,m,e,d){'use strict';m.exports=t=>{if('string'!=typeof t)throw new TypeError('Expected a string');return t.replace(/[|\\{}()[\]^$+*?.]/g,'\\$&').replace(/-/g,'\\x2d')}}),187,[]); -__d((function(g,_r,_i,_a,m,_e,d){function e(t){if("function"!=typeof WeakMap)return null;var r=new WeakMap,n=new WeakMap;return(e=function(e){return e?n:r})(t)}Object.defineProperty(_e,"__esModule",{value:!0}),_e.default=void 0;const t=(function(t,r){if(!r&&t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var n=e(r);if(n&&n.has(t))return n.get(t);var o={__proto__:null},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var f in t)if("default"!==f&&{}.hasOwnProperty.call(t,f)){var a=u?Object.getOwnPropertyDescriptor(t,f):null;a&&(a.get||a.set)?Object.defineProperty(o,f,a):o[f]=t[f]}return o.default=t,n&&n.set(t,o),o})(_r(d[0])).createContext(void 0);_e.default=t}),188,[14]); -__d((function(g,_r,_i,_a,m,_e,d){function e(t){if("function"!=typeof WeakMap)return null;var r=new WeakMap,n=new WeakMap;return(e=function(e){return e?n:r})(t)}Object.defineProperty(_e,"__esModule",{value:!0}),_e.default=void 0;const t=(function(t,r){if(!r&&t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var n=e(r);if(n&&n.has(t))return n.get(t);var o={__proto__:null},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var f in t)if("default"!==f&&{}.hasOwnProperty.call(t,f)){var a=u?Object.getOwnPropertyDescriptor(t,f):null;a&&(a.get||a.set)?Object.defineProperty(o,f,a):o[f]=t[f]}return o.default=t,n&&n.set(t,o),o})(_r(d[0])).createContext(void 0);_e.default=t}),189,[14]); -__d((function(g,_r,_i,_a,m,_e,d){var e=_r(d[0]);Object.defineProperty(_e,"__esModule",{value:!0}),_e.default=function(e){let{children:l}=e;const[a]=t.useState((()=>(0,_r(d[6]).nanoid)())),[i,f]=t.useState(new Map),s=t.useContext(r.default),c=t.useContext(o.default),p=t.useContext(u.default),y=null==p?void 0:p.setPreventRemove,w=(0,n.default)(((e,t,n)=>{if(n&&(null==s||null!=s&&s.getState().routes.every((e=>e.key!==t))))throw new Error(`Couldn't find a route with the key ${t}. Is your component inside NavigationContent?`);f((r=>{var o,u;if(t===(null===(o=r.get(e))||void 0===o?void 0:o.routeKey)&&n===(null===(u=r.get(e))||void 0===u?void 0:u.preventRemove))return r;const l=new Map(r);return n?l.set(e,{routeKey:t,preventRemove:n}):l.delete(e),l}))})),_=[...i.values()].some((e=>{let{preventRemove:t}=e;return t}));t.useEffect((()=>{if(void 0!==(null==c?void 0:c.key)&&void 0!==y)return y(a,c.key,_),()=>{y(a,c.key,!1)}}),[a,_,null==c?void 0:c.key,y]);const k=t.useMemo((()=>({setPreventRemove:w,preventedRoutes:v(i)})),[w,i]);return t.createElement(u.default.Provider,{value:k},l)};var t=(function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=l(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&{}.hasOwnProperty.call(e,u)){var v=o?Object.getOwnPropertyDescriptor(e,u):null;v&&(v.get||v.set)?Object.defineProperty(r,u,v):r[u]=e[u]}return r.default=e,n&&n.set(e,r),r})(_r(d[1])),n=e(_r(d[2])),r=e(_r(d[3])),o=e(_r(d[4])),u=e(_r(d[5]));function l(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(l=function(e){return e?n:t})(e)}const v=e=>[...e.values()].reduce(((e,t)=>{var n;let{routeKey:r,preventRemove:o}=t;return e[r]={preventRemove:(null===(n=e[r])||void 0===n?void 0:n.preventRemove)||o},e}),{})}),190,[1,14,191,188,153,189,165]); -__d((function(g,r,i,a,m,e,d){"use strict";var t=r(d[0]);m.exports=function(n){var u=t.useRef(n),c=t.useRef((function(){for(var t=[],n=0;n{let t,n=!1;const r=()=>{const t=e();if(void 0===t||'function'==typeof t)return t};o.isFocused()&&(t=r(),n=!0);const u=o.addListener('focus',(()=>{n||(void 0!==t&&t(),t=r(),n=!0)})),a=o.addListener('blur',(()=>{void 0!==t&&t(),t=void 0,n=!1}));return()=>{void 0!==t&&t(),u(),a()}}),[e,o])};var t=(function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=o(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&{}.hasOwnProperty.call(e,a)){var c=u?Object.getOwnPropertyDescriptor(e,a):null;c&&(c.get||c.set)?Object.defineProperty(r,a,c):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r})(_r(d[1])),n=e(_r(d[2]));function o(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(o=function(e){return e?n:t})(e)}}),194,[1,14,195]); -__d((function(g,_r,_i,_a,m,_e,d){var e=_r(d[0]);Object.defineProperty(_e,"__esModule",{value:!0}),_e.default=function(){const e=t.useContext(n.default),o=t.useContext(r.default);if(void 0===o&&void 0===e)throw new Error("Couldn't find a navigation object. Is your component inside NavigationContainer?");return o??e};var t=(function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=o(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&{}.hasOwnProperty.call(e,a)){var i=u?Object.getOwnPropertyDescriptor(e,a):null;i&&(i.get||i.set)?Object.defineProperty(r,a,i):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r})(_r(d[1])),n=e(_r(d[2])),r=e(_r(d[3]));function o(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(o=function(e){return e?n:t})(e)}}),195,[1,14,151,152]); -__d((function(g,_r,_i,_a,m,_e,d){var e=_r(d[0]);Object.defineProperty(_e,"__esModule",{value:!0}),_e.default=function(){const e=(0,n.default)(),[u,o]=(0,t.useState)(e.isFocused),f=e.isFocused();u!==f&&o(f);return r.useEffect((()=>{const t=e.addListener('focus',(()=>o(!0))),r=e.addListener('blur',(()=>o(!1)));return()=>{t(),r()}}),[e]),r.useDebugValue(f),f};var t=(function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=u(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var f in e)if("default"!==f&&{}.hasOwnProperty.call(e,f)){var a=o?Object.getOwnPropertyDescriptor(e,f):null;a&&(a.get||a.set)?Object.defineProperty(n,f,a):n[f]=e[f]}return n.default=e,r&&r.set(e,n),n})(_r(d[1])),r=t,n=e(_r(d[2]));function u(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(u=function(e){return e?r:t})(e)}}),196,[1,14,195]); -__d((function(g,_r,_i,_a,m,_e,d){var e=_r(d[0]);Object.defineProperty(_e,"__esModule",{value:!0}),_e.default=function(e,n){const p=(0,j.default)(),I=r.useContext(i.default),{children:K,screenListeners:R}=n,_=(0,t.default)(n,E),{current:G}=r.useRef(e(Object.assign({},_,null!=I&&I.params&&null==I.params.state&&!1!==I.params.initial&&'string'==typeof I.params.screen?{initialRouteName:I.params.screen}:null))),$=N(K),A=$.reduce(((e,t)=>{if(t.props.name in e)throw new Error(`A navigator cannot contain multiple 'Screen' components with the same name (found duplicate screen named '${t.props.name}')`);return e[t.props.name]=t,e}),{}),M=$.map((e=>e.props.name)),F=M.reduce(((e,t)=>(e[t]=A[t].keys.map((e=>e??'')).join(':'),e)),{}),x=M.reduce(((e,t)=>{const{initialParams:r}=A[t].props;return e[t]=r,e}),{}),J=M.reduce(((e,t)=>Object.assign(e,{[t]:A[t].props.getId})),{});if(!M.length)throw new Error("Couldn't find any screens for the navigator. Have you defined any screens as its children?");const V=r.useCallback((e=>void 0===e.type||e.type===G.type),[G.type]),W=r.useCallback((e=>void 0!==e&&!1===e.stale&&V(e)),[V]),{state:D,getState:T,setState:H,setKey:q,getKey:z,getIsInitial:B}=r.useContext(u.default),Q=r.useRef(!1),U=r.useCallback((()=>{H(void 0),Q.current=!0}),[H]),X=r.useCallback((e=>{Q.current||H(e)}),[H]),[Y,Z]=r.useMemo((()=>{var e;const t=M.reduce(((e,t)=>{var r,n,a;const{initialParams:o}=A[t].props,s=null==(null==I||null===(r=I.params)||void 0===r?void 0:r.state)&&!1!==(null==I||null===(n=I.params)||void 0===n?void 0:n.initial)&&(null==I||null===(a=I.params)||void 0===a?void 0:a.screen)===t?I.params.params:void 0;return e[t]=void 0!==o||void 0!==s?Object.assign({},o,s):void 0,e}),{});var r;return void 0!==D&&V(D)||null!=(null==I||null===(e=I.params)||void 0===e?void 0:e.state)?[G.getRehydratedState((null==I||null===(r=I.params)||void 0===r?void 0:r.state)??D,{routeNames:M,routeParamList:t,routeGetIdList:J}),!1]:[G.getInitialState({routeNames:M,routeParamList:t,routeGetIdList:J}),!0]}),[D,G,V]),ee=r.useRef(F);r.useEffect((()=>{ee.current=F}));const te=ee.current;let re=W(D)?D:Y,ne=re;(0,a.default)(re.routeNames,M)&&(0,o.default)(F,te)||(ne=G.getStateForRouteNamesChange(re,{routeNames:M,routeParamList:x,routeGetIdList:J,routeKeyChanges:Object.keys(F).filter((e=>te.hasOwnProperty(e)&&F[e]!==te[e]))}));const ae=r.useRef(null==I?void 0:I.params);if(r.useEffect((()=>{ae.current=null==I?void 0:I.params}),[null==I?void 0:I.params]),null!=I&&I.params){const e=ae.current;let t;'object'==typeof I.params.state&&null!=I.params.state&&I.params!==e?t=_r(d[26]).CommonActions.reset(I.params.state):'string'==typeof I.params.screen&&(!1===I.params.initial&&Z||I.params!==e)&&(t=_r(d[26]).CommonActions.navigate({name:I.params.screen,params:I.params.params,path:I.params.path}));const r=t?G.getStateForAction(ne,t,{routeNames:M,routeParamList:x,routeGetIdList:J}):null;ne=null!==r?G.getRehydratedState(r,{routeNames:M,routeParamList:x,routeGetIdList:J}):ne}const oe=re!==ne;(0,C.default)((()=>{oe&&X(ne)})),re=ne,r.useEffect((()=>(q(p),B()||X(ne),()=>{setTimeout((()=>{void 0!==T()&&z()===p&&U()}),0)})),[]);const se=r.useRef();se.current=Y;const ie=r.useCallback((()=>{const e=T();return W(e)?e:se.current}),[T,W]),ue=(0,h.default)((e=>{let t,r=[];var n;e.target?(t=re.routes.find((t=>t.key===e.target)),null!==(n=t)&&void 0!==n&&n.name&&r.push(t.name)):(t=re.routes[re.index],r.push(...Object.keys(A).filter((e=>{var r;return(null===(r=t)||void 0===r?void 0:r.name)===e}))));if(null==t)return;const a=ye[t.key].navigation;[].concat(...[R,...r.map((e=>{const{listeners:t}=A[e].props;return t}))].map((r=>{const n='function'==typeof r?r({route:t,navigation:a}):r;return n?Object.keys(n).filter((t=>t===e.type)).map((e=>null==n?void 0:n[e])):void 0}))).filter(((e,t,r)=>e&&r.lastIndexOf(e)===t)).forEach((t=>null==t?void 0:t(e)))}));(0,O.default)({state:re,emitter:ue}),r.useEffect((()=>{ue.emit({type:'state',data:{state:re}})}),[ue,re]);const{listeners:le,addListener:pe}=(0,c.default)(),{keyedListeners:de,addKeyedListener:ce}=(0,b.default)(),fe=(0,k.default)({router:G,getState:ie,setState:X,key:null==I?void 0:I.key,actionListeners:le.action,beforeRemoveListeners:de.beforeRemove,routerConfigOptions:{routeNames:M,routeParamList:x,routeGetIdList:J},emitter:ue}),me=(0,P.default)({router:G,key:null==I?void 0:I.key,getState:ie,setState:X}),ve=(0,L.default)({id:n.id,onAction:fe,getState:ie,emitter:ue,router:G});(0,S.default)({navigation:ve,focusedListeners:le.focus}),(0,w.default)({getState:ie,getStateListeners:de.getState});const ye=(0,y.default)({state:re,screens:A,navigation:ve,screenOptions:n.screenOptions,defaultScreenOptions:n.defaultScreenOptions,onAction:fe,getState:ie,setState:X,onRouteFocus:me,addListener:pe,addKeyedListener:ce,router:G,emitter:ue});(0,v.default)({state:re,navigation:ve,descriptors:ye});const ge=(0,f.default)((e=>r.createElement(s.default.Provider,{value:ve},r.createElement(l.default,null,e))));return{state:re,navigation:ve,descriptors:ye,NavigationContent:ge}};var t=e(_r(d[1])),r=(function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=I(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&{}.hasOwnProperty.call(e,o)){var s=a?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(n,o,s):n[o]=e[o]}return n.default=e,r&&r.set(e,n),n})(_r(d[2])),n=e(_r(d[3])),a=e(_r(d[4])),o=e(_r(d[5])),s=e(_r(d[6])),i=e(_r(d[7])),u=e(_r(d[8])),l=e(_r(d[9])),p=e(_r(d[10])),c=e(_r(d[11])),f=e(_r(d[12])),v=e(_r(d[13])),y=e(_r(d[14])),h=e(_r(d[15])),S=e(_r(d[16])),O=e(_r(d[17])),b=e(_r(d[18])),L=e(_r(d[19])),k=e(_r(d[20])),w=e(_r(d[21])),P=e(_r(d[22])),j=e(_r(d[23])),C=e(_r(d[24]));const E=["children","screenListeners"];function I(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(I=function(e){return e?r:t})(e)}_r(d[25]).PrivateValueStore;const K=e=>void 0===e||'string'==typeof e&&''!==e,N=(e,t,a)=>r.Children.toArray(e).reduce(((e,o)=>{var s,i;if(r.isValidElement(o)){if(o.type===p.default){if(!K(o.props.navigationKey))throw new Error(`Got an invalid 'navigationKey' prop (${JSON.stringify(o.props.navigationKey)}) for the screen '${o.props.name}'. It must be a non-empty string or 'undefined'.`);return e.push({keys:[t,o.props.navigationKey],options:a,props:o.props}),e}if(o.type===r.Fragment||o.type===n.default){if(!K(o.props.navigationKey))throw new Error(`Got an invalid 'navigationKey' prop (${JSON.stringify(o.props.navigationKey)}) for the group. It must be a non-empty string or 'undefined'.`);return e.push(...N(o.props.children,o.props.navigationKey,o.type!==n.default?a:null!=a?[...a,o.props.screenOptions]:[o.props.screenOptions])),e}}throw new Error(`A navigator can only contain 'Screen', 'Group' or 'React.Fragment' as its direct children (found ${r.isValidElement(o)?`'${'string'==typeof o.type?o.type:null===(s=o.type)||void 0===s?void 0:s.name}'${null!=o.props&&'object'==typeof o.props&&'name'in o.props&&null!==(i=o.props)&&void 0!==i&&i.name?` for the screen '${o.props.name}'`:''}`:'object'==typeof o?JSON.stringify(o):`'${String(o)}'`}). To render this component in the navigator, pass it in the 'component' prop to 'Screen'.`)}),[])}),197,[1,28,14,172,198,199,188,153,154,190,173,156,200,201,202,157,206,207,158,208,209,211,212,213,170,193,162]); -__d((function(g,r,i,_a,m,e,d){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(n,t){if(n===t)return!0;if(n.length!==t.length)return!1;return n.every(((n,u)=>n===t[u]))}}),198,[]); -__d((function(g,r,i,_a,m,e,d){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,n){if(t===n)return!0;const u=Object.keys(t),c=Object.keys(n);if(u.length!==c.length)return!1;return u.every((u=>t[u]===n[u]))}}),199,[]); -__d((function(g,_r,_i,_a,m,_e,d){Object.defineProperty(_e,"__esModule",{value:!0}),_e.default=function(r){const n=e.useRef(r);return n.current=r,e.useEffect((()=>{n.current=null})),e.useRef((r=>{let{children:u}=r;const o=n.current;if(null===o)throw new Error('The returned component must be rendered in the same render phase as the hook.');return e.createElement(t,{render:o},u)})).current};var e=(function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=r(t);if(n&&n.has(e))return n.get(e);var u={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var c in e)if("default"!==c&&{}.hasOwnProperty.call(e,c)){var f=o?Object.getOwnPropertyDescriptor(e,c):null;f&&(f.get||f.set)?Object.defineProperty(u,c,f):u[c]=e[c]}return u.default=e,n&&n.set(e,u),u})(_r(d[0]));function r(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(r=function(e){return e?n:t})(e)}const t=e=>{let{render:r,children:t}=e;return r(t)}}),200,[14]); -__d((function(g,_r,_i,_a,m,_e,d){var e=_r(d[0]);Object.defineProperty(_e,"__esModule",{value:!0}),_e.default=function(e){let{state:n,navigation:o,descriptors:u}=e;const a=t.useContext(r.default);a&&o.isFocused()&&(a.options=u[n.routes[n.index].key].options)};var t=(function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=n(t);if(r&&r.has(e))return r.get(e);var o={__proto__:null},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&{}.hasOwnProperty.call(e,a)){var i=u?Object.getOwnPropertyDescriptor(e,a):null;i&&(i.get||i.set)?Object.defineProperty(o,a,i):o[a]=e[a]}return o.default=e,r&&r.set(e,o),o})(_r(d[1])),r=e(_r(d[2]));function n(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(n=function(e){return e?r:t})(e)}}),201,[1,14,174]); -__d((function(g,_r,_i,_a,m,_e,d){var e=_r(d[0]);Object.defineProperty(_e,"__esModule",{value:!0}),_e.default=function(e){let{state:c,screens:l,navigation:p,screenOptions:v,defaultScreenOptions:y,onAction:O,getState:b,setState:k,addListener:P,addKeyedListener:j,onRouteFocus:S,router:_,emitter:h}=e;const[w,M]=n.useState({}),{onDispatchAction:E,onOptionsChange:A,stackRef:D}=n.useContext(r.default),L=n.useMemo((()=>({navigation:p,onAction:O,addListener:P,addKeyedListener:j,onRouteFocus:S,onDispatchAction:E,onOptionsChange:A,stackRef:D})),[p,O,P,j,S,E,A,D]),R=(0,u.default)({state:c,getState:b,navigation:p,setOptions:M,router:_,emitter:h});return(0,s.default)(c.routes).reduce(((e,u,s)=>{const p=l[u.name],O=p.props,P=R[u.key],j=[v,...p.options?p.options.filter(Boolean):[],O.options,w[u.key]].reduce(((e,t)=>Object.assign(e,'function'!=typeof t?t:t({route:u,navigation:P}))),{}),S=Object.assign({},'function'==typeof y?y({route:u,navigation:P,options:j}):y,j),_=()=>M((e=>{if(u.key in e){const n=u.key;return(0,t.default)(e,[n].map(f))}return e}));return e[u.key]={route:u,navigation:P,render:()=>n.createElement(r.default.Provider,{key:u.key,value:L},n.createElement(o.default.Provider,{value:P},n.createElement(a.default.Provider,{value:u},n.createElement(i.default,{navigation:P,route:u,screen:O,routeState:c.routes[s].state,getState:b,setState:k,options:S,clearOptions:_})))),options:S},e}),{})};var t=e(_r(d[1])),n=(function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=c(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&{}.hasOwnProperty.call(e,a)){var i=o?Object.getOwnPropertyDescriptor(e,a):null;i&&(i.get||i.set)?Object.defineProperty(r,a,i):r[a]=e[a]}return r.default=e,n&&n.set(e,r),r})(_r(d[2])),r=e(_r(d[3])),o=e(_r(d[4])),a=e(_r(d[5])),i=e(_r(d[6])),u=e(_r(d[7])),s=e(_r(d[8]));function c(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(c=function(e){return e?n:t})(e)}function f(e){var t=l(e,"string");return"symbol"==typeof t?t:t+""}function l(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}}),202,[1,28,14,150,152,153,203,205,177]); -__d((function(g,_r,_i,_a,m,_e,d){var e=_r(d[0]);Object.defineProperty(_e,"__esModule",{value:!0}),_e.default=function(e){let{screen:u,route:l,navigation:i,routeState:c,getState:s,setState:f,options:p,clearOptions:y}=e;const v=t.useRef(),k=t.useCallback((()=>v.current),[]),{addOptionsGetter:b}=(0,o.default)({key:l.key,options:p,navigation:i}),O=t.useCallback((e=>{v.current=e}),[]),_=t.useCallback((()=>{const e=s().routes.find((e=>e.key===l.key));return e?e.state:void 0}),[s,l.key]),j=t.useCallback((e=>{const t=s();f(Object.assign({},t,{routes:t.routes.map((t=>t.key===l.key?Object.assign({},t,{state:e}):t))}))}),[s,l.key,f]),C=t.useRef(!0);t.useEffect((()=>{C.current=!1})),t.useEffect((()=>y),[]);const P=t.useCallback((()=>C.current),[]),E=t.useMemo((()=>({state:c,getState:_,setState:j,getKey:k,setKey:O,getIsInitial:P,addOptionsGetter:b})),[c,_,j,k,O,P,b]),M=u.getComponent?u.getComponent():u.component;return t.createElement(r.default.Provider,{value:E},t.createElement(n.default,null,t.createElement(a.default,{name:u.name,render:M||u.children,navigation:i,route:l},void 0!==M?t.createElement(M,{navigation:i,route:l}):void 0!==u.children?u.children({navigation:i,route:l}):null)))};var t=(function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=u(t);if(n&&n.has(e))return n.get(e);var r={__proto__:null},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&{}.hasOwnProperty.call(e,o)){var l=a?Object.getOwnPropertyDescriptor(e,o):null;l&&(l.get||l.set)?Object.defineProperty(r,o,l):r[o]=e[o]}return r.default=e,n&&n.set(e,r),r})(_r(d[1])),n=e(_r(d[2])),r=e(_r(d[3])),a=e(_r(d[4])),o=e(_r(d[5]));function u(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(u=function(e){return e?n:t})(e)}}),203,[1,14,148,154,204,159]); -__d((function(g,_r,_i,_a,m,_e,d){Object.defineProperty(_e,"__esModule",{value:!0}),_e.default=void 0;var e=(function(e,r){if(!r&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=t(r);if(n&&n.has(e))return n.get(e);var o={__proto__:null},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var f in e)if("default"!==f&&{}.hasOwnProperty.call(e,f)){var i=u?Object.getOwnPropertyDescriptor(e,f):null;i&&(i.get||i.set)?Object.defineProperty(o,f,i):o[f]=e[f]}return o.default=e,n&&n.set(e,o),o})(_r(d[0]));function t(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap,n=new WeakMap;return(t=function(e){return e?n:r})(e)}function r(e){return e.children}_e.default=e.memo(r,((e,t)=>{const r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(const n of r)if('children'!==n&&e[n]!==t[n])return!1;return!0}))}),204,[14]); -__d((function(g,_r,_i,_a,m,_e,d){var e=_r(d[0]);Object.defineProperty(_e,"__esModule",{value:!0}),_e.default=function(e){let{state:u,getState:c,navigation:s,setOptions:a,router:i,emitter:f}=e;const{stackRef:l}=r.useContext(n.default),y=r.useMemo((()=>({current:{}})),[c,s,a,i,f]),p=Object.assign({},i.actionCreators,_r(d[4]).CommonActions);return y.current=u.routes.reduce(((e,r)=>{const n=y.current[r.key];if(n)e[r.key]=n;else{const n=(0,t.default)(s,o),u=e=>{const t='function'==typeof e?e(c()):e;null!=t&&s.dispatch(Object.assign({source:r.key},t))},i=e=>{try{e()}finally{}},l=Object.keys(p).reduce(((e,t)=>(e[t]=function(){for(var e=arguments.length,r=new Array(e),n=0;nu(p[t](...r))))},e)),{});e[r.key]=Object.assign({},n,l,f.create(r.key),{dispatch:e=>i((()=>u(e))),getParent:t=>void 0!==t&&t===n.getId()?e[r.key]:n.getParent(t),setOptions:e=>a((t=>Object.assign({},t,{[r.key]:Object.assign({},t[r.key],e)}))),isFocused:()=>{const e=c();return e.routes[e.index].key===r.key&&(!s||s.isFocused())}})}return e}),{}),y.current};var t=e(_r(d[1])),r=(function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=u(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var c in e)if("default"!==c&&{}.hasOwnProperty.call(e,c)){var s=o?Object.getOwnPropertyDescriptor(e,c):null;s&&(s.get||s.set)?Object.defineProperty(n,c,s):n[c]=e[c]}return n.default=e,r&&r.set(e,n),n})(_r(d[2])),n=e(_r(d[3]));const o=["emit"];function u(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(u=function(e){return e?r:t})(e)}}),205,[1,28,14,150,162]); -__d((function(g,_r,_i,_a,m,_e,d){var e=_r(d[0]);Object.defineProperty(_e,"__esModule",{value:!0}),_e.default=function(e){let{navigation:n,focusedListeners:u}=e;const{addListener:o}=t.useContext(r.default),l=t.useCallback((e=>{if(n.isFocused()){for(const t of u){const{handled:r,result:n}=t(e);if(r)return{handled:r,result:n}}return{handled:!0,result:e(n)}}return{handled:!1,result:null}}),[u,n]);t.useEffect((()=>null==o?void 0:o('focus',l)),[o,l])};var t=(function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=n(t);if(r&&r.has(e))return r.get(e);var u={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in e)if("default"!==l&&{}.hasOwnProperty.call(e,l)){var f=o?Object.getOwnPropertyDescriptor(e,l):null;f&&(f.get||f.set)?Object.defineProperty(u,l,f):u[l]=e[l]}return u.default=e,r&&r.set(e,u),u})(_r(d[1])),r=e(_r(d[2]));function n(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(n=function(e){return e?r:t})(e)}}),206,[1,14,150]); -__d((function(g,_r,_i,_a,m,_e,d){var e=_r(d[0]);Object.defineProperty(_e,"__esModule",{value:!0}),_e.default=function(e){let{state:n,emitter:u}=e;const o=t.useContext(r.default),f=t.useRef(),i=n.routes[n.index].key;t.useEffect((()=>null==o?void 0:o.addListener('focus',(()=>{f.current=i,u.emit({type:'focus',target:i})}))),[i,u,o]),t.useEffect((()=>null==o?void 0:o.addListener('blur',(()=>{f.current=void 0,u.emit({type:'blur',target:i})}))),[i,u,o]),t.useEffect((()=>{const e=f.current;f.current=i,void 0!==e||o||u.emit({type:'focus',target:i}),e===i||o&&!o.isFocused()||void 0!==e&&(u.emit({type:'blur',target:e}),u.emit({type:'focus',target:i}))}),[i,u,o])};var t=(function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=n(t);if(r&&r.has(e))return r.get(e);var u={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var f in e)if("default"!==f&&{}.hasOwnProperty.call(e,f)){var i=o?Object.getOwnPropertyDescriptor(e,f):null;i&&(i.get||i.set)?Object.defineProperty(u,f,i):u[f]=e[f]}return u.default=e,r&&r.set(e,u),u})(_r(d[1])),r=e(_r(d[2]));function n(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(n=function(e){return e?r:t})(e)}}),207,[1,14,152]); -__d((function(g,_r,_i,_a,m,_e,d){var e=_r(d[0]);Object.defineProperty(_e,"__esModule",{value:!0}),_e.default=function(e){let{id:o,onAction:u,getState:a,emitter:i,router:c}=e;const s=t.useContext(n.default),f=t.useContext(r.default);return t.useMemo((()=>{const e=e=>{const t='function'==typeof e?e(a()):e;u(t)||null==s||s(t)},t=Object.assign({},c.actionCreators,_r(d[5]).CommonActions),r=Object.keys(t).reduce(((r,n)=>(r[n]=function(){return e(t[n](...arguments))},r)),{}),n=Object.assign({},f,r,{dispatch:e,emit:i.emit,isFocused:f?f.isFocused:()=>!0,canGoBack:()=>{const e=a();return null!==c.getStateForAction(e,_r(d[5]).CommonActions.goBack(),{routeNames:e.routeNames,routeParamList:{},routeGetIdList:{}})||(null==f?void 0:f.canGoBack())||!1},getId:()=>o,getParent:e=>{if(void 0!==e){let t=n;for(;t&&e!==t.getId();)t=t.getParent();return t}return f},getState:a});return n}),[o,i.emit,a,u,s,f,c])};var t=(function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=o(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&{}.hasOwnProperty.call(e,a)){var i=u?Object.getOwnPropertyDescriptor(e,a):null;i&&(i.get||i.set)?Object.defineProperty(n,a,i):n[a]=e[a]}return n.default=e,r&&r.set(e,n),n})(_r(d[1])),r=e(_r(d[2])),n=e(_r(d[3]));function o(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(o=function(e){return e?r:t})(e)}_r(d[4]).PrivateValueStore}),208,[1,14,152,155,193,162]); -__d((function(g,_r,_i,_a,m,_e,d){var e=_r(d[0]);Object.defineProperty(_e,"__esModule",{value:!0}),_e.default=function(e){let{router:o,getState:u,setState:i,key:f,actionListeners:a,beforeRemoveListeners:l,routerConfigOptions:c,emitter:s}=e;const{onAction:p,onRouteFocus:v,addListener:y,onDispatchAction:_}=t.useContext(r.default),b=t.useRef(c);t.useEffect((()=>{b.current=c}));const h=t.useCallback((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Set;const r=u();if(t.has(r.key))return!1;if(t.add(r.key),'string'!=typeof e.target||e.target===r.key){let t=o.getStateForAction(r,e,b.current);if(t=null===t&&e.target===r.key?r:t,null!==t){if(_(e,r===t),r!==t){if((0,n.shouldPreventRemove)(s,l,r.routes,t.routes,e))return!0;i(t)}if(void 0!==v){o.shouldActionChangeFocus(e)&&void 0!==f&&v(f)}return!0}}if(void 0!==p&&p(e,t))return!0;for(let r=a.length-1;r>=0;r--){if((0,a[r])(e,t))return!0}return!1}),[a,l,s,u,f,p,_,v,o,i]);return(0,n.default)({getState:u,emitter:s,beforeRemoveListeners:l}),t.useEffect((()=>null==y?void 0:y('action',h)),[y,h]),h};var t=u(_r(d[1])),r=e(_r(d[2])),n=u(_r(d[3]));function o(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(o=function(e){return e?r:t})(e)}function u(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=o(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&{}.hasOwnProperty.call(e,i)){var f=u?Object.getOwnPropertyDescriptor(e,i):null;f&&(f.get||f.set)?Object.defineProperty(n,i,f):n[i]=e[i]}return n.default=e,r&&r.set(e,n),n}}),209,[1,14,150,210]); -__d((function(g,_r,_i,_a,m,_e,d){var e=_r(d[0]);Object.defineProperty(_e,"__esModule",{value:!0}),_e.default=function(e){let{getState:o,emitter:u,beforeRemoveListeners:a}=e;const{addKeyedListener:i}=t.useContext(r.default),l=t.useContext(n.default),c=null==l?void 0:l.key;t.useEffect((()=>{if(c)return null==i?void 0:i('beforeRemove',c,(e=>{const t=o();return f(u,a,t.routes,[],e)}))}),[i,a,u,o,c])},_e.shouldPreventRemove=void 0;var t=(function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=o(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var f in e)if("default"!==f&&{}.hasOwnProperty.call(e,f)){var a=u?Object.getOwnPropertyDescriptor(e,f):null;a&&(a.get||a.set)?Object.defineProperty(n,f,a):n[f]=e[f]}return n.default=e,r&&r.set(e,n),n})(_r(d[1])),r=e(_r(d[2])),n=e(_r(d[3]));function o(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(o=function(e){return e?r:t})(e)}const u=Symbol('VISITED_ROUTE_KEYS'),f=(e,t,r,n,o)=>{const f=n.map((e=>e.key)),a=r.filter((e=>!f.includes(e.key))).reverse(),i=o[u]??new Set,l=Object.assign({},o,{[u]:i});for(const r of a){var c;if(i.has(r.key))continue;if(null===(c=t[r.key])||void 0===c?void 0:c.call(t,l))return!0;i.add(r.key);if(e.emit({type:'beforeRemove',target:r.key,data:{action:l},canPreventDefault:!0}).defaultPrevented)return!0}return!1};_e.shouldPreventRemove=f}),210,[1,14,150,153]); -__d((function(g,_r,_i,_a,m,_e,d){var e=_r(d[0]);Object.defineProperty(_e,"__esModule",{value:!0}),_e.default=function(e){let{getState:a,getStateListeners:o}=e;const{addKeyedListener:l}=t.useContext(n.default),f=t.useContext(u.default),s=f?f.key:'root',i=t.useCallback((()=>{const e=a(),t=e.routes.map((e=>{var t;const r=null===(t=o[e.key])||void 0===t?void 0:t.call(o);return e.state===r?e:Object.assign({},e,{state:r})}));return(0,r.default)(e.routes,t)?e:Object.assign({},e,{routes:t})}),[a,o]);t.useEffect((()=>null==l?void 0:l('getState',s,i)),[l,i,s])};var t=(function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=a(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&{}.hasOwnProperty.call(e,o)){var l=u?Object.getOwnPropertyDescriptor(e,o):null;l&&(l.get||l.set)?Object.defineProperty(n,o,l):n[o]=e[o]}return n.default=e,r&&r.set(e,n),n})(_r(d[1])),r=e(_r(d[2])),n=e(_r(d[3])),u=e(_r(d[4]));function a(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(a=function(e){return e?r:t})(e)}}),211,[1,14,198,150,153]); -__d((function(g,_r,_i,_a,m,_e,d){var e=_r(d[0]);Object.defineProperty(_e,"__esModule",{value:!0}),_e.default=function(e){let{router:n,getState:o,key:u,setState:a}=e;const{onRouteFocus:f}=t.useContext(r.default);return t.useCallback((e=>{const t=o(),r=n.getStateForRouteFocus(t,e);r!==t&&a(r),void 0!==f&&void 0!==u&&f(u)}),[o,f,n,a,u])};var t=(function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=n(t);if(r&&r.has(e))return r.get(e);var o={__proto__:null},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&{}.hasOwnProperty.call(e,a)){var f=u?Object.getOwnPropertyDescriptor(e,a):null;f&&(f.get||f.set)?Object.defineProperty(o,a,f):o[a]=e[a]}return o.default=e,r&&r.set(e,o),o})(_r(d[1])),r=e(_r(d[2]));function n(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(n=function(e){return e?r:t})(e)}}),212,[1,14,150]); -__d((function(g,_r,_i,_a,m,_e,d){Object.defineProperty(_e,"__esModule",{value:!0}),_e.default=function(){const[t]=e.useState((()=>(0,_r(d[1]).nanoid)())),r=e.useContext(_r(d[2]).SingleNavigatorContext);if(void 0===r)throw new Error("Couldn't register the navigator. Have you wrapped your app with 'NavigationContainer'?\n\nThis can also happen if there are multiple copies of '@react-navigation' packages installed.");return e.useEffect((()=>{const{register:e,unregister:n}=r;return e(t),()=>n(t)}),[r,t]),t};var e=(function(e,r){if(!r&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=t(r);if(n&&n.has(e))return n.get(e);var o={__proto__:null},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&{}.hasOwnProperty.call(e,i)){var u=a?Object.getOwnPropertyDescriptor(e,i):null;u&&(u.get||u.set)?Object.defineProperty(o,i,u):o[i]=e[i]}return o.default=e,n&&n.set(e,o),o})(_r(d[0]));function t(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap,n=new WeakMap;return(t=function(e){return e?n:r})(e)}}),213,[14,165,148]); -__d((function(g,_r,_i,_a,m,_e,d){var e=_r(d[0]);Object.defineProperty(_e,"__esModule",{value:!0}),_e.default=function(){const e=t.useRef(null);null==e.current&&(e.current=(0,r.default)());return e.current};var t=(function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=n(t);if(r&&r.has(e))return r.get(e);var u={__proto__:null},f=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&{}.hasOwnProperty.call(e,o)){var a=f?Object.getOwnPropertyDescriptor(e,o):null;a&&(a.get||a.set)?Object.defineProperty(u,o,a):u[o]=e[o]}return u.default=e,r&&r.set(e,u),u})(_r(d[1])),r=e(_r(d[2]));function n(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(n=function(e){return e?r:t})(e)}}),214,[1,14,161]); -__d((function(g,_r,_i,_a,m,_e,d){var e=_r(d[0]);Object.defineProperty(_e,"__esModule",{value:!0}),_e.default=function(e){const n=(0,r.default)(),[,u]=t.useState((()=>e(n.getState()))),a=t.useRef(e);return t.useEffect((()=>{a.current=e})),t.useEffect((()=>n.addListener('state',(e=>{u(a.current(e.data.state))}))),[n]),e(n.getState())};var t=(function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=n(t);if(r&&r.has(e))return r.get(e);var u={__proto__:null},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var f in e)if("default"!==f&&{}.hasOwnProperty.call(e,f)){var o=a?Object.getOwnPropertyDescriptor(e,f):null;o&&(o.get||o.set)?Object.defineProperty(u,f,o):u[f]=e[f]}return u.default=e,r&&r.set(e,u),u})(_r(d[1])),r=e(_r(d[2]));function n(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(n=function(e){return e?r:t})(e)}}),215,[1,14,195]); -__d((function(g,_r,_i,_a,m,_e,d){var e=_r(d[0]);Object.defineProperty(_e,"__esModule",{value:!0}),_e.default=function(e,f){const[o]=t.useState((()=>(0,_r(d[6]).nanoid)())),l=(0,n.default)(),{key:i}=(0,a.default)(),{setPreventRemove:c}=(0,u.default)();t.useEffect((()=>(c(o,i,e),()=>{c(o,i,!1)})),[c,o,i,e]);const p=(0,r.default)((t=>{e&&(t.preventDefault(),f({data:t.data}))}));t.useEffect((()=>null==l?void 0:l.addListener('beforeRemove',p)),[l,p])};var t=(function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=f(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&{}.hasOwnProperty.call(e,a)){var o=u?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(n,a,o):n[a]=e[a]}return n.default=e,r&&r.set(e,n),n})(_r(d[1])),r=e(_r(d[2])),n=e(_r(d[3])),u=e(_r(d[4])),a=e(_r(d[5]));function f(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(f=function(e){return e?r:t})(e)}}),216,[1,14,191,195,217,218,165]); -__d((function(g,_r,_i,_a,m,_e,d){var e=_r(d[0]);Object.defineProperty(_e,"__esModule",{value:!0}),_e.default=function(){const e=t.useContext(n.default);if(null==e)throw new Error("Couldn't find the prevent remove context. Is your component inside NavigationContent?");return e};var t=(function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=r(t);if(n&&n.has(e))return n.get(e);var o={__proto__:null},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var f in e)if("default"!==f&&{}.hasOwnProperty.call(e,f)){var a=u?Object.getOwnPropertyDescriptor(e,f):null;a&&(a.get||a.set)?Object.defineProperty(o,f,a):o[f]=e[f]}return o.default=e,n&&n.set(e,o),o})(_r(d[1])),n=e(_r(d[2]));function r(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(r=function(e){return e?n:t})(e)}}),217,[1,14,189]); -__d((function(g,_r,_i,_a,m,_e,d){var e=_r(d[0]);Object.defineProperty(_e,"__esModule",{value:!0}),_e.default=function(){const e=t.useContext(r.default);if(void 0===e)throw new Error("Couldn't find a route object. Is your component inside a screen in a navigator?");return e};var t=(function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=n(t);if(r&&r.has(e))return r.get(e);var o={__proto__:null},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&{}.hasOwnProperty.call(e,a)){var f=u?Object.getOwnPropertyDescriptor(e,a):null;f&&(f.get||f.set)?Object.defineProperty(o,a,f):o[a]=e[a]}return o.default=e,r&&r.set(e,o),o})(_r(d[1])),r=e(_r(d[2]));function n(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(n=function(e){return e?r:t})(e)}}),218,[1,14,153]); -__d((function(g,_r,_i,_a,m,_e,d){var e=_r(d[0]);Object.defineProperty(_e,"__esModule",{value:!0}),_e.default=void 0;var t=e(_r(d[1])),n=(function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=s(t);if(n&&n.has(e))return n.get(e);var a={__proto__:null},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in e)if("default"!==l&&{}.hasOwnProperty.call(e,l)){var i=r?Object.getOwnPropertyDescriptor(e,l):null;i&&(i.get||i.set)?Object.defineProperty(a,l,i):a[l]=e[l]}return a.default=e,n&&n.set(e,a),a})(_r(d[2])),a=e(_r(d[3])),r=e(_r(d[4])),l=e(_r(d[5])),i=e(_r(d[6])),o=e(_r(d[7])),u=e(_r(d[8])),f=e(_r(d[9]));const c=["theme","linking","fallback","documentTitle","onReady"];function s(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(s=function(e){return e?n:t})(e)}function p(){return p=Object.assign?Object.assign.bind():function(e){for(var t=1;t{_.current&&REACT_NAVIGATION_DEVTOOLS.set(_.current,{get linking(){return Object.assign({},O,{enabled:y,prefixes:(null==O?void 0:O.prefixes)??[],getStateFromPath:(null==O?void 0:O.getStateFromPath)??_r(d[10]).getStateFromPath,getPathFromState:(null==O?void 0:O.getPathFromState)??_r(d[10]).getPathFromState,getActionFromState:(null==O?void 0:O.getActionFromState)??_r(d[10]).getActionFromState})}})}));const[E,k]=(0,f.default)(j);n.useImperativeHandle(s,(()=>_.current));const A=n.useMemo((()=>({options:O})),[O]),F=null!=h.initialState||!y||E,w=n.useRef(P);return n.useEffect((()=>{w.current=P})),n.useEffect((()=>{var e;F&&(null===(e=w.current)||void 0===e||e.call(w))}),[F]),F?n.createElement(a.default.Provider,{value:A},n.createElement(l.default,{value:v},n.createElement(_r(d[10]).BaseNavigationContainer,p({},h,{initialState:null==h.initialState?k:h.initialState,ref:_})))):b}g.REACT_NAVIGATION_DEVTOOLS=new WeakMap;const O=n.forwardRef(v);_e.default=O}),219,[1,28,14,142,220,221,223,224,225,229,144]); -__d((function(g,r,i,a,m,e,d){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;e.default={dark:!1,colors:{primary:'rgb(0, 122, 255)',background:'rgb(242, 242, 242)',card:'rgb(255, 255, 255)',text:'rgb(28, 28, 30)',border:'rgb(216, 216, 216)',notification:'rgb(255, 59, 48)'}}}),220,[]); -__d((function(g,_r,_i,_a,m,_e,d){var e=_r(d[0]);Object.defineProperty(_e,"__esModule",{value:!0}),_e.default=function(e){let{value:n,children:u}=e;return t.createElement(r.default.Provider,{value:n},u)};var t=(function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=n(t);if(r&&r.has(e))return r.get(e);var u={__proto__:null},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&{}.hasOwnProperty.call(e,o)){var f=a?Object.getOwnPropertyDescriptor(e,o):null;f&&(f.get||f.set)?Object.defineProperty(u,o,f):u[o]=e[o]}return u.default=e,r&&r.set(e,u),u})(_r(d[1])),r=e(_r(d[2]));function n(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(n=function(e){return e?r:t})(e)}}),221,[1,14,222]); -__d((function(g,_r,_i,_a,m,_e,d){var e=_r(d[0]);Object.defineProperty(_e,"__esModule",{value:!0}),_e.default=void 0;var t=(function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=n(t);if(r&&r.has(e))return r.get(e);var o={__proto__:null},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&{}.hasOwnProperty.call(e,u)){var f=a?Object.getOwnPropertyDescriptor(e,u):null;f&&(f.get||f.set)?Object.defineProperty(o,u,f):o[u]=e[u]}return o.default=e,r&&r.set(e,o),o})(_r(d[1])),r=e(_r(d[2]));function n(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(n=function(e){return e?r:t})(e)}const o=t.createContext(r.default);o.displayName='ThemeContext';_e.default=o}),222,[1,14,220]); -__d((function(g,r,i,a,m,e,d){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(n){}}),223,[]); -__d((function(g,_r,_i,_a,m,_e,d){Object.defineProperty(_e,"__esModule",{value:!0}),_e.default=function(t){let{enabled:n=!0,formatter:r=(e,t)=>(null==e?void 0:e.title)??(null==t?void 0:t.name)}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e.useEffect((()=>{if(!n)return;const e=t.current;if(e){const t=r(e.getCurrentOptions(),e.getCurrentRoute());document.title=t}return null==e?void 0:e.addListener('options',(t=>{const n=r(t.data.options,null==e?void 0:e.getCurrentRoute());document.title=n}))}))};var e=(function(e,n){if(!n&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=t(n);if(r&&r.has(e))return r.get(e);var o={__proto__:null},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&{}.hasOwnProperty.call(e,i)){var l=u?Object.getOwnPropertyDescriptor(e,i):null;l&&(l.get||l.set)?Object.defineProperty(o,i,l):o[i]=e[i]}return o.default=e,r&&r.set(e,o),o})(_r(d[0]));function t(e){if("function"!=typeof WeakMap)return null;var n=new WeakMap,r=new WeakMap;return(t=function(e){return e?r:n})(e)}}),224,[14]); -__d((function(g,_r,_i,_a,m,_e,d){var e=_r(d[0]);Object.defineProperty(_e,"__esModule",{value:!0}),_e.default=function(e,s){let{independent:u,enabled:c=!0,config:l,getStateFromPath:f=_r(d[5]).getStateFromPath,getPathFromState:h=_r(d[5]).getPathFromState,getActionFromState:p=_r(d[5]).getActionFromState}=s;r.useEffect((()=>{}),[c,u]);const[v]=r.useState(n.default),y=r.useRef(c),R=r.useRef(l),k=r.useRef(f),w=r.useRef(h),P=r.useRef(p);r.useEffect((()=>{y.current=c,R.current=l,k.current=f,w.current=h,P.current=p}));const S=r.useContext(o.default),b=r.useCallback((()=>{let e;if(y.current){const t=(null==S?void 0:S.location)??window.location,r=t?t.pathname+t.search:void 0;r&&(e=k.current(r,R.current))}const t={then:t=>Promise.resolve(t?t(e):e),catch:()=>t};return t}),[]),_=r.useRef(void 0),F=r.useRef(void 0),O=r.useRef(void 0);return r.useEffect((()=>(_.current=v.index,v.listen((()=>{const t=e.current;if(!t||!c)return;const{location:r}=window,n=r.pathname+r.search,o=v.index,s=_.current??0;_.current=o,O.current=n;const a=v.get(o);if((null==a?void 0:a.path)===n&&null!=a&&a.state)return void t.resetRoot(a.state);const i=k.current(n,R.current);if(i){const e=t.getRootState();if(i.routes.some((t=>!(null!=e&&e.routeNames.includes(t.name)))))return void console.warn("The navigation state parsed from the URL contains routes not present in the root navigator. This usually means that the linking configuration doesn't match the navigation structure. See https://reactnavigation.org/docs/configuring-links for more details on how to specify a linking configuration.");if(o>s){const e=P.current(i,R.current);if(void 0!==e)try{t.dispatch(e)}catch(e){console.warn(`An error occurred when trying to handle the link '${n}': ${'object'==typeof e&&null!=e&&'message'in e?e.message:e}`)}else t.resetRoot(i)}else t.resetRoot(i)}else t.resetRoot(i)})))),[c,v,e]),r.useEffect((()=>{var r;if(!c)return;const n=(e,r)=>{if(null!=e&&e.path){const r=k.current(e.path,R.current);if(r){const n=(0,_r(d[5]).findFocusedRoute)(r);if(n&&n.name===e.name&&(0,t.default)(n.params,e.params))return e.path}}return w.current(r,R.current)};if(e.current){const t=e.current.getRootState();if(t){const e=(0,_r(d[5]).findFocusedRoute)(t),r=n(e,t);void 0===F.current&&(F.current=t),v.replace({path:r,state:t})}}return null===(r=e.current)||void 0===r?void 0:r.addListener('state',i((async()=>{const t=e.current;if(!t||!c)return;const r=F.current,o=t.getRootState();if(!o)return;const s=O.current,i=(0,_r(d[5]).findFocusedRoute)(o),u=n(i,o);F.current=o,O.current=void 0;const[l,f]=a(r,o);if(l&&f&&u!==s){const e=(f.history?f.history.length:f.routes.length)-(l.history?l.history.length:l.routes.length);if(e>0)v.push({path:u,state:o});else if(e<0){const t=v.backIndex({path:u}),r=v.index;try{-1!==t&&t{if(void 0===e||void 0===t||e.key!==t.key)return[void 0,void 0];const r=e.history?e.history.length:e.routes.length,n=t.history?t.history.length:t.routes.length,o=e.routes[e.index],s=t.routes[t.index],i=o.state,u=s.state;return r!==n||o.key!==s.key||void 0===i||void 0===u||i.key!==u.key?[e,t]:a(i,u)},i=e=>{let t=Promise.resolve();return()=>{t=t.then(e)}};_e.series=i}),225,[1,226,14,227,228,144]); -__d((function(g,r,_i,_a,m,e,d){'use strict';m.exports=function t(n,o){if(n===o)return!0;if(n&&o&&'object'==typeof n&&'object'==typeof o){if(n.constructor!==o.constructor)return!1;var f,u,i;if(Array.isArray(n)){if((f=n.length)!=o.length)return!1;for(u=f;0!=u--;)if(!t(n[u],o[u]))return!1;return!0}if(n.constructor===RegExp)return n.source===o.source&&n.flags===o.flags;if(n.valueOf!==Object.prototype.valueOf)return n.valueOf()===o.valueOf();if(n.toString!==Object.prototype.toString)return n.toString()===o.toString();if((f=(i=Object.keys(n)).length)!==Object.keys(o).length)return!1;for(u=f;0!=u--;)if(!Object.prototype.hasOwnProperty.call(o,i[u]))return!1;for(u=f;0!=u--;){var c=i[u];if(!t(n[c],o[c]))return!1}return!0}return n!=n&&o!=o}}),226,[]); -__d((function(g,r,_i,a,m,e,d){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(){let t=0,n=[];const i=[],o=()=>{i.forEach((t=>{const n=t.cb;t.cb=()=>n(!0)}))};return{get index(){var t;const i=null===(t=window.history.state)||void 0===t?void 0:t.id;if(i){const t=n.findIndex((t=>t.id===i));return t>-1?t:0}return 0},get:t=>n[t],backIndex(i){let{path:o}=i;for(let i=t-1;i>=0;i--){if(n[i].path===o)return i}return-1},push(i){let{path:s,state:c}=i;o();const l=(0,r(d[0]).nanoid)();n=n.slice(0,t+1),n.push({path:s,state:c,id:l}),t=n.length-1,window.history.pushState({id:l},'',s)},replace(i){var s;let{path:c,state:l}=i;o();const h=(null===(s=window.history.state)||void 0===s?void 0:s.id)??(0,r(d[0]).nanoid)();let w=c;!n.length||n.findIndex((t=>t.id===h))<0?(w+=location.hash,n=[{path:w,state:l,id:h}],t=0):(n[t].path===c&&(w+=location.hash),n[t]={path:c,state:l,id:h}),window.history.replaceState({id:h},'',w)},go(s){o();const c=t+s,l=n.length-1;if(s<0&&!n[c]?(s=-t,t=0):s>0&&c>l?(s=l-t,t=l):t=c,0!==s)return new Promise(((o,c)=>{const l=t=>{if(clearTimeout(h),t)return void c(new Error('History was changed during navigation.'));const{title:n}=window.document;window.document.title='',window.document.title=n,o()};i.push({ref:l,cb:l});const h=setTimeout((()=>{const t=i.findIndex((t=>t.ref===l));t>-1&&(i[t].cb(),i.splice(t,1))}),100),w=()=>{var o;const s=null===(o=window.history.state)||void 0===o?void 0:o.id,c=n.findIndex((t=>t.id===s));t=Math.max(c,0);const l=i.pop();window.removeEventListener('popstate',w),null==l||l.cb()};window.addEventListener('popstate',w),window.history.go(s)}))},listen(t){const n=()=>{i.length||t()};return window.addEventListener('popstate',n),()=>window.removeEventListener('popstate',n)}}}}),227,[165]); -__d((function(g,_r,_i,_a,m,_e,d){function e(t){if("function"!=typeof WeakMap)return null;var r=new WeakMap,n=new WeakMap;return(e=function(e){return e?n:r})(t)}Object.defineProperty(_e,"__esModule",{value:!0}),_e.default=void 0;const t=(function(t,r){if(!r&&t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var n=e(r);if(n&&n.has(t))return n.get(t);var o={__proto__:null},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var f in t)if("default"!==f&&{}.hasOwnProperty.call(t,f)){var a=u?Object.getOwnPropertyDescriptor(t,f):null;a&&(a.get||a.set)?Object.defineProperty(o,f,a):o[f]=t[f]}return o.default=t,n&&n.set(t,o),o})(_r(d[0])).createContext(void 0);_e.default=t}),228,[14]); -__d((function(g,_r,_i,_a,m,_e,d){Object.defineProperty(_e,"__esModule",{value:!0}),_e.default=function(t){const[r]=e.useState(t);let n=[!1,void 0];r.then((e=>{n=[!0,e]}));const[u,o]=e.useState(n),[a]=u;return e.useEffect((()=>{let e=!1;return a||(async()=>{let t;try{t=await r}finally{e||o([!0,t])}})(),()=>{e=!0}}),[r,a]),u};var e=(function(e,r){if(!r&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=t(r);if(n&&n.has(e))return n.get(e);var u={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&{}.hasOwnProperty.call(e,a)){var f=o?Object.getOwnPropertyDescriptor(e,a):null;f&&(f.get||f.set)?Object.defineProperty(u,a,f):u[a]=e[a]}return u.default=e,n&&n.set(e,u),u})(_r(d[0]));function t(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap,n=new WeakMap;return(t=function(e){return e?n:r})(e)}}),229,[14]); -__d((function(g,_r,_i,_a,m,_e,d){var e=_r(d[0]);Object.defineProperty(_e,"__esModule",{value:!0}),_e.default=void 0;var r=(function(e,r){if(!r&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=n(r);if(t&&t.has(e))return t.get(e);var o={__proto__:null},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var f in e)if("default"!==f&&{}.hasOwnProperty.call(e,f)){var a=u?Object.getOwnPropertyDescriptor(e,f):null;a&&(a.get||a.set)?Object.defineProperty(o,f,a):o[f]=e[f]}return o.default=e,t&&t.set(e,o),o})(_r(d[1])),t=e(_r(d[2]));function n(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap,t=new WeakMap;return(n=function(e){return e?t:r})(e)}_e.default=r.forwardRef((function(e,n){let{children:o,location:u}=e;r.useEffect((()=>{console.error("'ServerContainer' should only be used on the server with 'react-dom/server' for SSR.")}),[]);const f={};if(n){const e={getCurrentOptions:()=>f.options};'function'==typeof n?n(e):n.current=e}return r.createElement(t.default.Provider,{value:{location:u}},r.createElement(_r(d[3]).CurrentRenderContext.Provider,{value:f},o))}))}),230,[1,14,228,144]); -__d((function(g,r,i,a,m,e,d){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;e.default={dark:!0,colors:{primary:'rgb(10, 132, 255)',background:'rgb(1, 1, 1)',card:'rgb(18, 18, 18)',text:'rgb(229, 229, 231)',border:'rgb(39, 39, 41)',notification:'rgb(255, 69, 58)'}}}),231,[]); -__d((function(g,_r,_i,_a,m,_e,d){var e=_r(d[0]);Object.defineProperty(_e,"__esModule",{value:!0}),_e.default=function(){return t.useContext(r.default)};var t=(function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=n(t);if(r&&r.has(e))return r.get(e);var u={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var f in e)if("default"!==f&&{}.hasOwnProperty.call(e,f)){var a=o?Object.getOwnPropertyDescriptor(e,f):null;a&&(a.get||a.set)?Object.defineProperty(u,f,a):u[f]=e[f]}return u.default=e,r&&r.set(e,u),u})(_r(d[1])),r=e(_r(d[2]));function n(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(n=function(e){return e?r:t})(e)}}),232,[1,14,222]); -__d((function(g,r,i,a,m,e,d){Object.defineProperty(e,"__esModule",{value:!0})}),233,[]); -__d((function(g,_r,_i,_a,m,_e,d){var e=_r(d[0]);Object.defineProperty(_e,"__esModule",{value:!0}),_e.default=function(){const e=t.useContext(_r(d[3]).NavigationHelpersContext),r=t.useContext(n.default);return t.useCallback(((t,n)=>{const{options:a}=r;if(!1===(null==a?void 0:a.enabled))return;const u=e?o(e,{index:0,routes:[{name:t,params:n}]}):{index:0,routes:[{name:t,params:n}]};return null!=a&&a.getPathFromState?a.getPathFromState(u,null==a?void 0:a.config):(0,_r(d[3]).getPathFromState)(u,null==a?void 0:a.config)}),[r,e])};var t=(function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=r(t);if(n&&n.has(e))return n.get(e);var o={__proto__:null},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&{}.hasOwnProperty.call(e,u)){var i=a?Object.getOwnPropertyDescriptor(e,u):null;i&&(i.get||i.set)?Object.defineProperty(o,u,i):o[u]=e[u]}return o.default=e,n&&n.set(e,o),o})(_r(d[1])),n=e(_r(d[2]));function r(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(r=function(e){return e?n:t})(e)}const o=(e,t)=>{const n=e.getParent();if(n){const e=n.getState();return o(n,{index:0,routes:[Object.assign({},e.routes[e.index],{state:t})]})}return t}}),234,[1,14,142,144]); -__d((function(g,_r,_i,_a,m,_e,d){Object.defineProperty(_e,"__esModule",{value:!0}),_e.default=function(t){const n=e.useContext(_r(d[1]).NavigationContext),o=(0,_r(d[1]).useRoute)();if(void 0===n)throw new Error("Couldn't find a navigation object. Is your component inside NavigationContainer?");e.useEffect((()=>{const e=[];let l=n;for(;l;)'tab'===l.getState().type&&e.push(l),l=l.getParent();if(0===e.length)return;const c=e.map((l=>l.addListener('tabPress',(l=>{const c=n.isFocused(),u=e.includes(n)||n.getState().routes[0].key===o.key;requestAnimationFrame((()=>{const e=r(t);c&&u&&e&&!l.defaultPrevented&&('scrollToTop'in e?e.scrollToTop():'scrollTo'in e?e.scrollTo({y:0,animated:!0}):'scrollToOffset'in e?e.scrollToOffset({offset:0,animated:!0}):'scrollResponderScrollTo'in e&&e.scrollResponderScrollTo({y:0,animated:!0}))}))}))));return()=>{c.forEach((e=>e()))}}),[n,t,o.key])};var e=(function(e,r){if(!r&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=t(r);if(n&&n.has(e))return n.get(e);var o={__proto__:null},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var c in e)if("default"!==c&&{}.hasOwnProperty.call(e,c)){var u=l?Object.getOwnPropertyDescriptor(e,c):null;u&&(u.get||u.set)?Object.defineProperty(o,c,u):o[c]=e[c]}return o.default=e,n&&n.set(e,o),o})(_r(d[0]));function t(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap,n=new WeakMap;return(t=function(e){return e?n:r})(e)}function r(e){return null==e.current?null:'scrollToTop'in e.current||'scrollTo'in e.current||'scrollToOffset'in e.current||'scrollResponderScrollTo'in e.current?e.current:'getScrollResponder'in e.current?e.current.getScrollResponder():'getNode'in e.current?e.current.getNode():e.current}}),235,[14,144]); -__d((function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,n,u){let f;t.width,t.height;return f=64,64+u};t(r(d[1]))}),236,[1,77]); -__d((function(g,r,i,a,m,e,d){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,l){return'string'==typeof t.headerTitle?t.headerTitle:void 0!==t.title?t.title:l}}),237,[]); -__d((function(g,_r,_i,_a,m,_e,d){var e=_r(d[0]);Object.defineProperty(_e,"__esModule",{value:!0}),_e.default=function(e){const u=(0,_r(d[11]).useSafeAreaInsets)(),c=(0,_r(d[11]).useSafeAreaFrame)(),p=r.useContext(s.default),y=u.top,{layout:R=c,modal:C=!1,title:w,headerTitle:S,headerTitleAlign:E="left",headerLeft:W,headerLeftLabelVisible:x,headerTransparent:T,headerTintColor:B,headerBackground:v,headerRight:O,headerTitleAllowFontScaling:L,headerTitleStyle:_,headerLeftContainerStyle:j,headerRightContainerStyle:k,headerTitleContainerStyle:H,headerBackgroundContainerStyle:P,headerStyle:V,headerShadowVisible:M,headerPressColor:F,headerPressOpacity:I,headerStatusBarHeight:A=(p?0:y)}=e,D=(0,n.default)(R,C,A),z=a.default.flatten(V||{}),{height:G=D,minHeight:q,maxHeight:J,backgroundColor:K,borderBottomColor:N,borderBottomEndRadius:Q,borderBottomLeftRadius:U,borderBottomRightRadius:X,borderBottomStartRadius:Y,borderBottomWidth:Z,borderColor:$,borderEndColor:ee,borderEndWidth:te,borderLeftColor:re,borderLeftWidth:oe,borderRadius:de,borderRightColor:ae,borderRightWidth:ie,borderStartColor:ne,borderStartWidth:le,borderStyle:se,borderTopColor:he,borderTopEndRadius:be,borderTopLeftRadius:ue,borderTopRightRadius:fe,borderTopStartRadius:ce,borderTopWidth:pe,borderWidth:me,boxShadow:ge,elevation:ye,shadowColor:Re,shadowOffset:Ce,shadowOpacity:we,shadowRadius:Se,opacity:Ee,transform:We}=z,xe=((0,t.default)(z,b),{backgroundColor:K,borderBottomColor:N,borderBottomEndRadius:Q,borderBottomLeftRadius:U,borderBottomRightRadius:X,borderBottomStartRadius:Y,borderBottomWidth:Z,borderColor:$,borderEndColor:ee,borderEndWidth:te,borderLeftColor:re,borderLeftWidth:oe,borderRadius:de,borderRightColor:ae,borderRightWidth:ie,borderStartColor:ne,borderStartWidth:le,borderStyle:se,borderTopColor:he,borderTopEndRadius:be,borderTopLeftRadius:ue,borderTopRightRadius:fe,borderTopStartRadius:ce,borderTopWidth:pe,borderWidth:me,boxShadow:ge,elevation:ye,shadowColor:Re,shadowOffset:Ce,shadowOpacity:we,shadowRadius:Se,opacity:Ee,transform:We});for(const e in xe)void 0===xe[e]&&delete xe[e];const Te=[xe,!1===M&&{elevation:0,shadowOpacity:0,borderBottomWidth:0}],Be=W?W({tintColor:B,pressColor:F,pressOpacity:I,labelVisible:x}):null,ve=O?O({tintColor:B,pressColor:F,pressOpacity:I}):null,Oe='function'!=typeof S?e=>r.createElement(h.default,e):S;return r.createElement(r.Fragment,null,r.createElement(o.default.View,{pointerEvents:"box-none",style:[a.default.absoluteFill,{zIndex:0},P]},v?v({style:Te}):T?null:r.createElement(l.default,{style:Te})),r.createElement(o.default.View,{pointerEvents:"box-none",style:[{height:G,minHeight:q,maxHeight:J,opacity:Ee,transform:We}]},r.createElement(i.default,{pointerEvents:"none",style:{height:A}}),r.createElement(i.default,{pointerEvents:"box-none",style:f.content},r.createElement(o.default.View,{pointerEvents:"box-none",style:[f.left,'center'===E&&f.expand,{marginStart:u.left},j]},Be),r.createElement(o.default.View,{pointerEvents:"box-none",style:[f.title,{maxWidth:'center'===E?R.width-2*((Be?!1!==x?80:32:16)+Math.max(u.left,u.right)):R.width-((Be?72:16)+(ve?72:16)+u.left-u.right)},H]},Oe({children:w,allowFontScaling:L,tintColor:B,style:_})),r.createElement(o.default.View,{pointerEvents:"box-none",style:[f.right,f.expand,{marginEnd:u.right},k]},ve))))};var t=e(_r(d[1])),r=(function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=u(t);if(r&&r.has(e))return r.get(e);var o={__proto__:null},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&{}.hasOwnProperty.call(e,i)){var n=a?Object.getOwnPropertyDescriptor(e,i):null;n&&(n.get||n.set)?Object.defineProperty(o,i,n):o[i]=e[i]}return o.default=e,r&&r.set(e,o),o})(_r(d[2])),o=e(_r(d[3])),a=(e(_r(d[4])),e(_r(d[5]))),i=e(_r(d[6])),n=e(_r(d[7])),l=e(_r(d[8])),s=e(_r(d[9])),h=e(_r(d[10]));const b=["height","minHeight","maxHeight","backgroundColor","borderBottomColor","borderBottomEndRadius","borderBottomLeftRadius","borderBottomRightRadius","borderBottomStartRadius","borderBottomWidth","borderColor","borderEndColor","borderEndWidth","borderLeftColor","borderLeftWidth","borderRadius","borderRightColor","borderRightWidth","borderStartColor","borderStartWidth","borderStyle","borderTopColor","borderTopEndRadius","borderTopLeftRadius","borderTopRightRadius","borderTopStartRadius","borderTopWidth","borderWidth","boxShadow","elevation","shadowColor","shadowOffset","shadowOpacity","shadowRadius","opacity","transform"];function u(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(u=function(e){return e?r:t})(e)}const f=a.default.create({content:{flex:1,flexDirection:'row',alignItems:'stretch'},title:{marginHorizontal:16,justifyContent:'center'},left:{justifyContent:'center',alignItems:'flex-start'},right:{justifyContent:'center',alignItems:'flex-end'},expand:{flexGrow:1,flexBasis:0}})}),238,[1,28,14,239,77,27,122,236,321,322,324,325]); -__d((function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var u=t(r(d[1]));e.default=u.default}),239,[1,240]); -__d((function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var l=t(r(d[1])),u=t(r(d[2])),f=t(r(d[3])),o=t(r(d[4])),n=t(r(d[5])),s=t(r(d[6])),c=t(r(d[7])),v=t(r(d[8])),_=t(r(d[9])),w=t(r(d[10])),L=u.default.isTesting?_.default:w.default;e.default=(0,l.default)({FlatList:f.default,Image:o.default,ScrollView:n.default,SectionList:s.default,Text:c.default,View:v.default},L)}),240,[1,5,77,241,294,295,296,300,301,302,303]); -__d((function(g,_r,_i,_a,m,_e,d){var e=_r(d[0]);Object.defineProperty(_e,"__esModule",{value:!0}),_e.default=void 0;var t=e(_r(d[1])),r=(function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=a(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},f=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&{}.hasOwnProperty.call(e,u)){var o=f?Object.getOwnPropertyDescriptor(e,u):null;o&&(o.get||o.set)?Object.defineProperty(n,u,o):n[u]=e[u]}return n.default=e,r&&r.set(e,n),n})(_r(d[2])),n=e(_r(d[3])),f=e(_r(d[4]));function a(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(a=function(e){return e?r:t})(e)}var u=r.forwardRef(((e,f)=>r.createElement(n.default,(0,t.default)({scrollEventThrottle:1e-4},e,{ref:f}))));_e.default=(0,f.default)(u)}),241,[1,19,14,242,274]); -__d((function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var u=t(r(d[1]));e.default=u.default}),242,[1,243]); -__d((function(g,_r,_i,_a,m,_e,d){var e=_r(d[0]);Object.defineProperty(_e,"__esModule",{value:!0}),_e.default=void 0;var t=e(_r(d[1])),i=e(_r(d[2])),r=e(_r(d[3])),s=e(_r(d[4])),n=e(_r(d[5])),l=e(_r(d[6])),o=(e(_r(d[7])),e(_r(d[8]))),a=(function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var i=p(t);if(i&&i.has(e))return i.get(e);var r={__proto__:null},s=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if("default"!==n&&{}.hasOwnProperty.call(e,n)){var l=s?Object.getOwnPropertyDescriptor(e,n):null;l&&(l.get||l.set)?Object.defineProperty(r,n,l):r[n]=e[n]}return r.default=e,i&&i.set(e,r),r})(_r(d[9])),u=e(_r(d[10])),h=e(_r(d[11]));function p(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,i=new WeakMap;return(p=function(e){return e?i:t})(e)}var f=["numColumns","columnWrapperStyle","removeClippedSubviews","strictMode"];function c(e){return null!=e?e:1}function C(e){return'number'==typeof Object(e).length}class v extends a.PureComponent{scrollToEnd(e){this._listRef&&this._listRef.scrollToEnd(e)}scrollToIndex(e){this._listRef&&this._listRef.scrollToIndex(e)}scrollToItem(e){this._listRef&&this._listRef.scrollToItem(e)}scrollToOffset(e){this._listRef&&this._listRef.scrollToOffset(e)}recordInteraction(){this._listRef&&this._listRef.recordInteraction()}flashScrollIndicators(){this._listRef&&this._listRef.flashScrollIndicators()}getScrollResponder(){if(this._listRef)return this._listRef.getScrollResponder()}getNativeScrollRef(){if(this._listRef)return this._listRef.getScrollRef()}getScrollableNode(){if(this._listRef)return this._listRef.getScrollableNode()}constructor(e){super(e),this._virtualizedListPairs=[],this._captureRef=e=>{this._listRef=e},this._getItem=(e,t)=>{var i=c(this.props.numColumns);if(i>1){for(var r=[],s=0;s{if(null!=e&&C(e)){var t=c(this.props.numColumns);return t>1?Math.ceil(e.length/t):e.length}return 0},this._keyExtractor=(e,t)=>{var i,r=c(this.props.numColumns),s=null!==(i=this.props.keyExtractor)&&void 0!==i?i:_r(d[12]).keyExtractor;return r>1?((0,o.default)(Array.isArray(e),"FlatList: Encountered internal consistency error, expected each item to consist of an array with 1-%s columns; instead, received a single item.",r),e.map(((e,i)=>s(e,t*r+i))).join(':')):s(e,t)},this._renderer=(e,t,i,r,n)=>{var l=c(r),u=i=>e?a.createElement(e,i):t?t(i):null,h=e=>{if(l>1){var t=e.item,r=e.index;return(0,o.default)(Array.isArray(t),'Expected array of items with numColumns > 1'),a.createElement(s.default,{style:[b.row,i]},t.map(((t,i)=>{var s=u({item:t,index:r*l+i,separators:e.separators});return null!=s?a.createElement(a.Fragment,{key:i},s):null})))}return u(e)};return e?{ListItemComponent:h}:{renderItem:h}},this._memoizedRenderer=(0,h.default)(this._renderer),this._checkProps(this.props),this.props.viewabilityConfigCallbackPairs?this._virtualizedListPairs=this.props.viewabilityConfigCallbackPairs.map((e=>({viewabilityConfig:e.viewabilityConfig,onViewableItemsChanged:this._createOnViewableItemsChanged(e.onViewableItemsChanged)}))):this.props.onViewableItemsChanged&&this._virtualizedListPairs.push({viewabilityConfig:this.props.viewabilityConfig,onViewableItemsChanged:this._createOnViewableItemsChanged(this.props.onViewableItemsChanged)})}componentDidUpdate(e){(0,o.default)(e.numColumns===this.props.numColumns,"Changing numColumns on the fly is not supported. Change the key prop on FlatList when changing the number of columns to force a fresh render of the component."),(0,o.default)(e.onViewableItemsChanged===this.props.onViewableItemsChanged,'Changing onViewableItemsChanged on the fly is not supported'),(0,o.default)(!(0,l.default)(e.viewabilityConfig,this.props.viewabilityConfig),'Changing viewabilityConfig on the fly is not supported'),(0,o.default)(e.viewabilityConfigCallbackPairs===this.props.viewabilityConfigCallbackPairs,'Changing viewabilityConfigCallbackPairs on the fly is not supported'),this._checkProps(this.props)}_checkProps(e){var t=e.getItem,i=e.getItemCount,r=e.horizontal,s=e.columnWrapperStyle,n=e.onViewableItemsChanged,l=e.viewabilityConfigCallbackPairs,a=c(this.props.numColumns);(0,o.default)(!t&&!i,'FlatList does not support custom data formats.'),a>1?(0,o.default)(!r,'numColumns does not support horizontal.'):(0,o.default)(!s,'columnWrapperStyle not supported for single column lists'),(0,o.default)(!(n&&l),"FlatList does not support setting both onViewableItemsChanged and viewabilityConfigCallbackPairs.")}_pushMultiColumnViewable(e,t){var i,s=c(this.props.numColumns),n=null!==(i=this.props.keyExtractor)&&void 0!==i?i:_r(d[12]).keyExtractor;t.item.forEach(((i,l)=>{(0,o.default)(null!=t.index,'Missing index!');var a=t.index*s+l;e.push((0,r.default)((0,r.default)({},t),{},{item:i,key:n(i,a),index:a}))}))}_createOnViewableItemsChanged(e){return t=>{var i=c(this.props.numColumns);if(e)if(i>1){var r=[],s=[];t.viewableItems.forEach((e=>this._pushMultiColumnViewable(s,e))),t.changed.forEach((e=>this._pushMultiColumnViewable(r,e))),e({viewableItems:s,changed:r})}else e(t)}}render(){var e,r=this.props,s=r.numColumns,n=r.columnWrapperStyle,l=r.removeClippedSubviews,o=r.strictMode,h=void 0!==o&&o,p=(0,i.default)(r,f),c=h?this._memoizedRenderer:this._renderer;return a.createElement(u.default,(0,t.default)({},p,{getItem:this._getItem,getItemCount:this._getItemCount,keyExtractor:this._keyExtractor,ref:this._captureRef,viewabilityConfigCallbackPairs:this._virtualizedListPairs,removeClippedSubviews:(e=l,null!=e&&e)},c(this.props.ListItemComponent,this.props.renderItem,n,s,this.props.extraData)))}}var b=n.default.create({row:{flexDirection:'row'}});_e.default=v}),243,[1,19,28,5,122,27,244,77,10,14,245,273,272]); -__d((function(g,r,i,a,m,e,d){'use strict';Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;e.default=function t(n,f,u){if(void 0===u&&(u=-1),0===u)return!0;if(n===f)return!1;if('function'==typeof n&&'function'==typeof f)return!1;if('object'!=typeof n||null===n)return n!==f;if('object'!=typeof f||null===f)return!0;if(n.constructor!==f.constructor)return!0;if(Array.isArray(n)){var o=n.length;if(f.length!==o)return!0;for(var c=0;c=0;s--)if(t(e[s]))return e[s];return null}class k extends f.default{scrollToEnd(e){var t=!e||e.animated,s=this.props.getItemCount(this.props.data)-1;if(!(s<0)){var r=this.__getFrameMetricsApprox(s,this.props),i=Math.max(0,r.offset+r.length+this._footerLength-this._scrollMetrics.visibleLength);null!=this._scrollRef&&(null!=this._scrollRef.scrollTo?this._scrollRef.scrollTo(I(this.props.horizontal)?{x:i,animated:t}:{y:i,animated:t}):console.warn("No scrollTo method provided. This may be because you have two nested VirtualizedLists with the same orientation, or because you are using a custom component that does not implement scrollTo."))}}scrollToIndex(e){var t=this.props,s=t.data,r=t.horizontal,i=t.getItemCount,o=t.getItemLayout,l=t.onScrollToIndexFailed,n=e.animated,a=e.index,h=e.viewOffset,c=e.viewPosition;if((0,y.default)(a>=0,"scrollToIndex out of range: requested index "+a+" but minimum is 0"),(0,y.default)(i(s)>=1,"scrollToIndex out of range: item length "+i(s)+" but minimum is 1"),(0,y.default)(athis._highestMeasuredFrameIndex)return(0,y.default)(!!l,"scrollToIndex should be used in conjunction with getItemLayout or onScrollToIndexFailed, otherwise there is no way to know the location of offscreen indices or handle failures."),void l({averageItemLength:this._averageCellLength,highestMeasuredFrameIndex:this._highestMeasuredFrameIndex,index:a});var u=this.__getFrameMetricsApprox(Math.floor(a),this.props),p=Math.max(0,this._getOffsetApprox(a,this.props)-(c||0)*(this._scrollMetrics.visibleLength-u.length))-(h||0);null!=this._scrollRef&&(null!=this._scrollRef.scrollTo?this._scrollRef.scrollTo(r?{x:p,animated:n}:{y:p,animated:n}):console.warn("No scrollTo method provided. This may be because you have two nested VirtualizedLists with the same orientation, or because you are using a custom component that does not implement scrollTo."))}scrollToItem(e){for(var t=e.item,s=this.props,i=s.data,o=s.getItem,l=(0,s.getItemCount)(i),n=0;n{e.recordInteraction()})),this._viewabilityTuples.forEach((e=>{e.viewabilityHelper.recordInteraction()})),this._updateViewableItems(this.props,this.state.cellsAroundViewport)}flashScrollIndicators(){null!=this._scrollRef&&this._scrollRef.flashScrollIndicators()}getScrollResponder(){if(this._scrollRef&&this._scrollRef.getScrollResponder)return this._scrollRef.getScrollResponder()}getScrollableNode(){return this._scrollRef&&this._scrollRef.getScrollableNode?this._scrollRef.getScrollableNode():this._scrollRef}getScrollRef(){return this._scrollRef&&this._scrollRef.getScrollRef?this._scrollRef.getScrollRef():this._scrollRef}_getCellKey(){var e;return(null==(e=this.context)?void 0:e.cellKey)||'rootList'}hasMore(){return this._hasMore}constructor(e){var t;if(super(e),this._getScrollMetrics=()=>this._scrollMetrics,this._getOutermostParentListRef=()=>this._isNestedWithSameOrientation()?this.context.getOutermostParentListRef():this,this._registerAsNestedChild=e=>{this._nestedChildLists.add(e.ref,e.cellKey),this._hasInteracted&&e.ref.recordInteraction()},this._unregisterAsNestedChild=e=>{this._nestedChildLists.remove(e.ref)},this._onUpdateSeparators=(e,t)=>{e.forEach((e=>{var s=null!=e&&this._cellRefs[e];s&&s.updateSeparatorProps(t)}))},this._getSpacerKey=e=>e?'height':'width',this._averageCellLength=0,this._cellRefs={},this._frames={},this._footerLength=0,this._hasTriggeredInitialScrollToIndex=!1,this._hasInteracted=!1,this._hasMore=!1,this._hasWarned={},this._headerLength=0,this._hiPriInProgress=!1,this._highestMeasuredFrameIndex=0,this._indicesToKeys=new Map,this._lastFocusedCellKey=null,this._nestedChildLists=new u.default,this._offsetFromParentVirtualizedList=0,this._prevParentOffset=0,this._scrollMetrics={contentLength:0,dOffset:0,dt:10,offset:0,timestamp:0,velocity:0,visibleLength:0,zoomScale:1},this._scrollRef=null,this._sentStartForContentLength=0,this._sentEndForContentLength=0,this._totalCellLength=0,this._totalCellsMeasured=0,this._viewabilityTuples=[],this._captureScrollRef=e=>{this._scrollRef=e},this._defaultRenderScrollComponent=e=>{var t,r=e.onRefresh;return this._isNestedWithSameOrientation()?L.createElement(l.default,e):r?((0,y.default)('boolean'==typeof e.refreshing,'`refreshing` prop must be set as a boolean in order to use `onRefresh`, but got `'+JSON.stringify(null!==(t=e.refreshing)&&void 0!==t?t:'undefined')+'`'),L.createElement(o.default,(0,s.default)({},e,{refreshControl:null==e.refreshControl?L.createElement(i.default,{refreshing:e.refreshing,onRefresh:r,progressViewOffset:e.progressViewOffset}):e.refreshControl}))):L.createElement(o.default,e)},this._onCellLayout=(e,t,s)=>{var r=e.nativeEvent.layout,i={offset:this._selectOffset(r),length:this._selectLength(r),index:s,inLayout:!0},o=this._frames[t];o&&i.offset===o.offset&&i.length===o.length&&s===o.index?this._frames[t].inLayout=!0:(this._totalCellLength+=i.length-(o?o.length:0),this._totalCellsMeasured+=o?0:1,this._averageCellLength=this._totalCellLength/this._totalCellsMeasured,this._frames[t]=i,this._highestMeasuredFrameIndex=Math.max(this._highestMeasuredFrameIndex,s),this._scheduleCellsToRenderUpdate()),this._triggerRemeasureForChildListsInCell(t),this._computeBlankness(),this._updateViewableItems(this.props,this.state.cellsAroundViewport)},this._onCellUnmount=e=>{delete this._cellRefs[e];var t=this._frames[e];t&&(this._frames[e]=(0,r.default)((0,r.default)({},t),{},{inLayout:!1}))},this._onLayout=e=>{this._isNestedWithSameOrientation()?this.measureLayoutRelativeToContainingList():this._scrollMetrics.visibleLength=this._selectLength(e.nativeEvent.layout),this.props.onLayout&&this.props.onLayout(e),this._scheduleCellsToRenderUpdate(),this._maybeCallOnEdgeReached()},this._onLayoutEmpty=e=>{this.props.onLayout&&this.props.onLayout(e)},this._onLayoutFooter=e=>{this._triggerRemeasureForChildListsInCell(this._getFooterCellKey()),this._footerLength=this._selectLength(e.nativeEvent.layout)},this._onLayoutHeader=e=>{this._headerLength=this._selectLength(e.nativeEvent.layout)},this._onContentSizeChange=(e,t)=>{e>0&&t>0&&null!=this.props.initialScrollIndex&&this.props.initialScrollIndex>0&&!this._hasTriggeredInitialScrollToIndex&&(null==this.props.contentOffset&&(this.props.initialScrollIndex{var t=e.offset-this._offsetFromParentVirtualizedList,s=e.visibleLength,r=t-this._scrollMetrics.offset;return{visibleLength:s,contentLength:this._scrollMetrics.contentLength,offset:t,dOffset:r}},this._onScroll=e=>{this._nestedChildLists.forEach((t=>{t._onScroll(e)})),this.props.onScroll&&this.props.onScroll(e);var t=e.timeStamp,s=this._selectLength(e.nativeEvent.layoutMeasurement),r=this._selectLength(e.nativeEvent.contentSize),i=this._selectOffset(e.nativeEvent.contentOffset),o=i-this._scrollMetrics.offset;if(this._isNestedWithSameOrientation()){if(0===this._scrollMetrics.contentLength)return;var l=this._convertParentScrollMetrics({visibleLength:s,offset:i});s=l.visibleLength,r=l.contentLength,i=l.offset,o=l.dOffset}var n=this._scrollMetrics.timestamp?Math.max(1,t-this._scrollMetrics.timestamp):1,a=o/n;n>500&&this._scrollMetrics.dt>500&&r>5*s&&!this._hasWarned.perf&&((0,c.default)("VirtualizedList: You have a large list that is slow to update - make sure your renderItem function renders components that follow React performance best practices like PureComponent, shouldComponentUpdate, etc.",{dt:n,prevDt:this._scrollMetrics.dt,contentLength:r}),this._hasWarned.perf=!0);var h=e.nativeEvent.zoomScale<0?1:e.nativeEvent.zoomScale;this._scrollMetrics={contentLength:r,dt:n,dOffset:o,offset:i,timestamp:t,velocity:a,visibleLength:s,zoomScale:h},this._updateViewableItems(this.props,this.state.cellsAroundViewport),this.props&&(this._maybeCallOnEdgeReached(),0!==a&&this._fillRateHelper.activate(),this._computeBlankness(),this._scheduleCellsToRenderUpdate())},this._onScrollBeginDrag=e=>{this._nestedChildLists.forEach((t=>{t._onScrollBeginDrag(e)})),this._viewabilityTuples.forEach((e=>{e.viewabilityHelper.recordInteraction()})),this._hasInteracted=!0,this.props.onScrollBeginDrag&&this.props.onScrollBeginDrag(e)},this._onScrollEndDrag=e=>{this._nestedChildLists.forEach((t=>{t._onScrollEndDrag(e)}));var t=e.nativeEvent.velocity;t&&(this._scrollMetrics.velocity=this._selectOffset(t)),this._computeBlankness(),this.props.onScrollEndDrag&&this.props.onScrollEndDrag(e)},this._onMomentumScrollBegin=e=>{this._nestedChildLists.forEach((t=>{t._onMomentumScrollBegin(e)})),this.props.onMomentumScrollBegin&&this.props.onMomentumScrollBegin(e)},this._onMomentumScrollEnd=e=>{this._nestedChildLists.forEach((t=>{t._onMomentumScrollEnd(e)})),this._scrollMetrics.velocity=0,this._computeBlankness(),this.props.onMomentumScrollEnd&&this.props.onMomentumScrollEnd(e)},this._updateCellsToRender=()=>{this._updateViewableItems(this.props,this.state.cellsAroundViewport),this.setState(((e,t)=>{var s=this._adjustCellsAroundViewport(t,e.cellsAroundViewport),r=k._createRenderMask(t,s,this._getNonViewportRenderRegions(t));return s.first===e.cellsAroundViewport.first&&s.last===e.cellsAroundViewport.last&&r.equals(e.renderMask)?null:{cellsAroundViewport:s,renderMask:r}}))},this._createViewToken=(e,t,s)=>{var r=s.data,i=(0,s.getItem)(r,e);return{index:e,item:i,key:this._keyExtractor(i,e,s),isViewable:t}},this._getOffsetApprox=(e,t)=>{if(Number.isInteger(e))return this.__getFrameMetricsApprox(e,t).offset;var s=this.__getFrameMetricsApprox(Math.floor(e),t),r=e-Math.floor(e);return s.offset+r*s.length},this.__getFrameMetricsApprox=(e,t)=>{var s=this._getFrameMetrics(e,t);if(s&&s.index===e)return s;var r=t.data,i=t.getItemCount,o=t.getItemLayout;return(0,y.default)(e>=0&&e{var s=t.data,r=t.getItem,i=t.getItemCount,o=t.getItemLayout;(0,y.default)(e>=0&&e{if(!this._lastFocusedCellKey||!this._cellRefs[this._lastFocusedCellKey])return[];var t=this._cellRefs[this._lastFocusedCellKey].props.index,s=e.getItemCount(e.data);if(t>=s||this._keyExtractor(e.getItem(e.data,t),t,e)!==this._lastFocusedCellKey)return[];for(var r=t,i=0,o=r-1;o>=0&&i({viewabilityHelper:new _.default(e.viewabilityConfig),onViewableItemsChanged:e.onViewableItemsChanged})));else{var n=this.props,h=n.onViewableItemsChanged,f=n.viewabilityConfig;h&&this._viewabilityTuples.push({viewabilityHelper:new _.default(f),onViewableItemsChanged:h})}var v=k._initialRenderRegion(e);this.state={cellsAroundViewport:v,renderMask:k._createRenderMask(e,v)},this.invertedWheelEventHandler=e=>{var t=this.props.horizontal?e.target.scrollLeft:e.target.scrollTop,s=this.props.horizontal?e.target.scrollWidth:e.target.scrollHeight,r=this.props.horizontal?e.target.clientWidth:e.target.clientHeight,i=s>r,o=this.props.horizontal?e.deltaX||e.wheelDeltaX:e.deltaY||e.wheelDeltaY,l=o;i&&(l=o<0?Math.min(o+t,0):Math.max(o-(s-r-t),0));var n=o-l;if(this.props.inverted&&this._scrollRef&&this._scrollRef.getScrollableNode){var a=this._scrollRef.getScrollableNode();if(this.props.horizontal){e.target.scrollLeft+=n;var h=a.scrollLeft-l;a.scrollLeft=this.props.getItemLayout?h:Math.min(h,this._totalCellLength)}else{e.target.scrollTop+=n;var c=a.scrollTop-l;a.scrollTop=this.props.getItemLayout?c:Math.min(c,this._totalCellLength)}e.preventDefault()}}}_checkProps(e){var t=e.onScroll,s=e.windowSize,r=e.getItemCount,i=e.data,o=e.initialScrollIndex;(0,y.default)(!t||!t.__isNative,"Components based on VirtualizedList must be wrapped with Animated.createAnimatedComponent to support native onScroll events with useNativeDriver"),(0,y.default)(T(s)>0,'VirtualizedList: The windowSize prop must be present and set to a value greater than 0.'),(0,y.default)(r,'VirtualizedList: The "getItemCount" prop must be provided');var l=r(i);null==o||this._hasTriggeredInitialScrollToIndex||!(o<0||l>0&&o>=l)||this._hasWarned.initialScrollIndex||(console.warn("initialScrollIndex \""+o+"\" is not valid (list has "+l+" items)"),this._hasWarned.initialScrollIndex=!0)}static _createRenderMask(e,t,s){var r=e.getItemCount(e.data);(0,y.default)(t.first>=0&&t.last>=t.first-1&&t.last0){for(var o=0,l=[t,...null!=s?s:[]];o=0;o--)if(t.has(o+i)){s.addCells({first:o,last:o});break}}_adjustCellsAroundViewport(e,t){var s,r=e.data,i=e.getItemCount,o=x(e.onEndReachedThreshold),l=this._scrollMetrics,n=l.contentLength,a=l.offset,h=l.visibleLength,c=n-h-a;if(h<=0||n<=0)return t.last>=i(r)?k._constrainToItemCount(t,e):t;if(e.disableVirtualization){var u=c=Number.EPSILON)return t.last>=i(r)?k._constrainToItemCount(t,e):t;s=(0,_r(d[21]).computeWindowedRenderLimits)(e,R(e.maxToRenderPerBatch),T(e.windowSize),t,this.__getFrameMetricsApprox,this._scrollMetrics),(0,y.default)(s.last0){var p=this._findFirstChildWithMore(s.first,s.last);s.last=null!=p?p:s.last}return s}_findFirstChildWithMore(e,t){for(var s=e;s<=t;s++){var r=this._indicesToKeys.get(s);if(null!=r&&this._nestedChildLists.anyInCell(r,(e=>e.hasMore())))return s}return null}componentDidMount(){this._isNestedWithSameOrientation()&&this.context.registerAsNestedChild({ref:this,cellKey:this.context.cellKey}),this.setupWebWheelHandler()}componentWillUnmount(){this._isNestedWithSameOrientation()&&this.context.unregisterAsNestedChild({ref:this}),this._updateCellsToRenderBatcher.dispose({abort:!0}),this._viewabilityTuples.forEach((e=>{e.viewabilityHelper.dispose()})),this._fillRateHelper.deactivateAndFlush(),this.teardownWebWheelHandler()}setupWebWheelHandler(){this._scrollRef&&this._scrollRef.getScrollableNode?this._scrollRef.getScrollableNode().addEventListener('wheel',this.invertedWheelEventHandler):setTimeout((()=>this.setupWebWheelHandler()),50)}teardownWebWheelHandler(){this._scrollRef&&this._scrollRef.getScrollableNode&&this._scrollRef.getScrollableNode().removeEventListener('wheel',this.invertedWheelEventHandler)}static getDerivedStateFromProps(e,t){if(e.getItemCount(e.data)===t.renderMask.numCells())return t;var s=k._constrainToItemCount(t.cellsAroundViewport,e);return{cellsAroundViewport:s,renderMask:k._createRenderMask(e,s)}}_pushCells(e,t,r,i,o,l){var n,a=this,h=this.props,c=h.CellRendererComponent,u=h.ItemSeparatorComponent,p=h.ListHeaderComponent,f=h.ListItemComponent,_=h.data,y=h.debug,C=h.getItem,b=h.getItemCount,S=h.getItemLayout,M=h.horizontal,I=h.renderItem,R=p?1:0,w=b(_)-1;o=Math.min(w,o);for(var x=function(){var i=C(_,E),o=a._keyExtractor(i,E,a.props);a._indicesToKeys.set(E,o),r.has(E+R)&&t.push(e.length);var h=null==S||y||a._fillRateHelper.enabled();e.push(L.createElement(v.default,(0,s.default)({CellRendererComponent:c,ItemSeparatorComponent:Ea._onCellFocusCapture(o),onUnmount:a._onCellUnmount,ref:e=>{a._cellRefs[o]=e},renderItem:I},h&&{onCellLayout:a._onCellLayout}))),n=o},E=i;E<=o;E++)x()}static _constrainToItemCount(e,t){var s=t.getItemCount(t.data),r=Math.min(s-1,e.last),i=R(t.maxToRenderPerBatch);return{first:(0,h.default)(0,s-1-i,e.first),last:r}}_isNestedWithSameOrientation(){var e=this.context;return!(!e||!!e.horizontal!==I(this.props.horizontal))}_keyExtractor(e,t,s){if(null!=s.keyExtractor)return s.keyExtractor(e,t);var r=(0,_r(d[21]).keyExtractor)(e,t);return r===String(t)&&(S=!0,e.type&&e.type.displayName&&(M=e.type.displayName)),r}render(){this._checkProps(this.props);var e=this.props,s=e.ListEmptyComponent,i=e.ListFooterComponent,o=e.ListHeaderComponent,n=this.props,a=n.data,c=n.horizontal,u=this.props.inverted?I(this.props.horizontal)?V.horizontallyInverted:V.verticallyInverted:null,p=[],f=new Set(this.props.stickyHeaderIndices),_=[];if(o){f.has(0)&&_.push(0);var v=L.isValidElement(o)?o:L.createElement(o,null);p.push(L.createElement(_r(d[22]).VirtualizedListCellContextProvider,{cellKey:this._getCellKey()+'-header',key:"$header"},L.createElement(l.default,{onLayout:this._onLayoutHeader,style:[u,this.props.ListHeaderComponentStyle]},v)))}var y=this.props.getItemCount(a);if(0===y&&s){var C=L.isValidElement(s)?s:L.createElement(s,null);p.push(L.createElement(_r(d[22]).VirtualizedListCellContextProvider,{cellKey:this._getCellKey()+'-empty',key:"$empty"},L.cloneElement(C,{onLayout:e=>{this._onLayoutEmpty(e),C.props.onLayout&&C.props.onLayout(e)},style:[u,C.props.style]})))}if(y>0){S=!1,M='';for(var b,R=this._getSpacerKey(!c),w=this.state.renderMask.enumerateRegions(),x=F(w,(e=>e.isSpacer)),E=(0,t.default)(w);!(b=E()).done;){var T=b.value;if(T.isSpacer){if(this.props.disableVirtualization)continue;var k=T===x&&!this.props.getItemLayout?(0,h.default)(T.first-1,T.last,this._highestMeasuredFrameIndex):T.last,O=this.__getFrameMetricsApprox(T.first,this.props),z=this.__getFrameMetricsApprox(k,this.props),A=z.offset+z.length-O.offset;p.push(L.createElement(l.default,{key:"$spacer-"+T.first,style:{[R]:A}}))}else this._pushCells(p,_,f,T.first,T.last,u)}!this._hasWarned.keys&&S&&(console.warn("VirtualizedList: missing keys for items, make sure to specify a key or id property on each item or provide a custom keyExtractor.",M),this._hasWarned.keys=!0)}if(i){var P=L.isValidElement(i)?i:L.createElement(i,null);p.push(L.createElement(_r(d[22]).VirtualizedListCellContextProvider,{cellKey:this._getFooterCellKey(),key:"$footer"},L.createElement(l.default,{onLayout:this._onLayoutFooter,style:[u,this.props.ListFooterComponentStyle]},P)))}var W,N=(0,r.default)((0,r.default)({},this.props),{},{onContentSizeChange:this._onContentSizeChange,onLayout:this._onLayout,onScroll:this._onScroll,onScrollBeginDrag:this._onScrollBeginDrag,onScrollEndDrag:this._onScrollEndDrag,onMomentumScrollBegin:this._onMomentumScrollBegin,onMomentumScrollEnd:this._onMomentumScrollEnd,scrollEventThrottle:(W=this.props.scrollEventThrottle,null!=W?W:50),invertStickyHeaders:void 0!==this.props.invertStickyHeaders?this.props.invertStickyHeaders:this.props.inverted,stickyHeaderIndices:_,style:u?[u,this.props.style]:this.props.style});this._hasMore=this.state.cellsAroundViewport.last{e.viewabilityHelper.resetViewableIndices()}));var i=this._hiPriInProgress;this._scheduleCellsToRenderUpdate(),i&&(this._hiPriInProgress=!1)}_computeBlankness(){this._fillRateHelper.computeBlankness(this.props,this.state.cellsAroundViewport,this._scrollMetrics)}_onCellFocusCapture(e){this._lastFocusedCellKey=e,this._updateCellsToRender()}_triggerRemeasureForChildListsInCell(e){this._nestedChildLists.forEachInCell(e,(e=>{e.measureLayoutRelativeToContainingList()}))}measureLayoutRelativeToContainingList(){try{if(!this._scrollRef)return;this._scrollRef.measureLayout(this.context.getOutermostParentListRef().getScrollRef(),((e,t,s,r)=>{this._offsetFromParentVirtualizedList=this._selectOffset({x:e,y:t}),this._scrollMetrics.contentLength=this._selectLength({width:s,height:r});var i=this._convertParentScrollMetrics(this.context.getScrollMetrics());(this._scrollMetrics.visibleLength!==i.visibleLength||this._scrollMetrics.offset!==i.offset)&&(this._scrollMetrics.visibleLength=i.visibleLength,this._scrollMetrics.offset=i.offset,this._nestedChildLists.forEach((e=>{e.measureLayoutRelativeToContainingList()})))}),(e=>{console.warn("VirtualizedList: Encountered an error while measuring a list's offset from its containing VirtualizedList.")}))}catch(e){console.warn('measureLayoutRelativeToContainingList threw an error',e.stack)}}_getFooterCellKey(){return this._getCellKey()+'-footer'}_renderDebugOverlay(){for(var e=this._scrollMetrics.visibleLength/(this._scrollMetrics.contentLength||1),t=[],s=this.props.getItemCount(this.props.data),r=0;rL.createElement(l.default,{key:'f'+s,style:[V.debugOverlayBase,V.debugOverlayFrame,{top:t.offset*e,height:t.length*e}]}))),L.createElement(l.default,{style:[V.debugOverlayBase,V.debugOverlayFrameLast,{top:o*e,height:a*e}]}),L.createElement(l.default,{style:[V.debugOverlayBase,V.debugOverlayFrameVis,{top:h*e,height:c*e}]}))}_selectLength(e){return I(this.props.horizontal)?e.width:e.height}_selectOffset(e){return I(this.props.horizontal)?e.x:e.y}_maybeCallOnEdgeReached(){var e=this.props,t=e.data,s=e.getItemCount,r=e.onStartReached,i=e.onStartReachedThreshold,o=e.onEndReached,l=e.onEndReachedThreshold,n=e.initialScrollIndex,a=this._scrollMetrics,h=a.contentLength,c=a.visibleLength,u=a.offset,p=u,f=h-c-u;p<.001&&(p=0),f<.001&&(f=0);var _=p<=(null!=i?i*c:2),v=f<=(null!=l?l*c:2);o&&this.state.cellsAroundViewport.last===s(t)-1&&v&&this._scrollMetrics.contentLength!==this._sentEndForContentLength?(this._sentEndForContentLength=this._scrollMetrics.contentLength,o({distanceFromEnd:f})):null!=r&&0===this.state.cellsAroundViewport.first&&_&&this._scrollMetrics.contentLength!==this._sentStartForContentLength?n&&0===this._scrollMetrics.timestamp||(this._sentStartForContentLength=this._scrollMetrics.contentLength,r({distanceFromStart:p})):(this._sentStartForContentLength=_?this._sentStartForContentLength:0,this._sentEndForContentLength=v?this._sentEndForContentLength:0)}_scheduleCellsToRenderUpdate(){var e=this.state.cellsAroundViewport,t=e.first,s=e.last,r=this._scrollMetrics,i=r.offset,o=r.visibleLength,l=r.velocity,n=this.props.getItemCount(this.props.data),a=!1,h=w(this.props.onStartReachedThreshold),c=x(this.props.onEndReachedThreshold);if(t>0){var u=i-this.__getFrameMetricsApprox(t,this.props).offset;a=u<0||l<-2&&u=0&&s2&&p{s.viewabilityHelper.onUpdate(e,this._scrollMetrics.offset,this._scrollMetrics.visibleLength,this._getFrameMetrics,this._createViewToken,s.onViewableItemsChanged,t)}))}}k.contextType=_r(d[22]).VirtualizedListContext;var V=n.default.create({verticallyInverted:{transform:'scaleY(-1)'},horizontallyInverted:{transform:'scaleX(-1)'},debug:{flex:1},debugOverlayBase:{position:'absolute',top:0,right:0},debugOverlay:{bottom:0,width:20,borderColor:'blue',borderWidth:1},debugOverlayFrame:{left:0,backgroundColor:'orange'},debugOverlayFrameLast:{left:0,borderColor:'green',borderWidth:2},debugOverlayFrameVis:{left:0,borderColor:'red',borderWidth:2}});_e.default=k}),245,[1,246,19,5,249,250,122,27,256,257,262,263,264,265,266,267,268,10,270,14,271,272,269]); -__d((function(g,_r,i,a,m,_e,d){m.exports=function(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=_r(d[0])(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},m.exports.__esModule=!0,m.exports.default=m.exports}),246,[247]); -__d((function(g,_r,i,_a,m,e,d){m.exports=function(t,r){if(t){if("string"==typeof t)return _r(d[0])(t,r);var o={}.toString.call(t).slice(8,-1);return"Object"===o&&t.constructor&&(o=t.constructor.name),"Map"===o||"Set"===o?Array.from(t):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?_r(d[0])(t,r):void 0}},m.exports.__esModule=!0,m.exports.default=m.exports}),247,[248]); -__d((function(g,_r,i,_a,m,_e,d){m.exports=function(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=Array(r);tthis.isTouching,this.scrollResponderHandleStartShouldSetResponderCapture=e=>this.scrollResponderIsAnimating(),this.scrollResponderHandleTerminationRequest=()=>!this.observedScrollSinceBecomingResponder,this.scrollResponderHandleTouchEnd=e=>{var o=e.nativeEvent;this.isTouching=0!==o.touches.length,this.props.onTouchEnd&&this.props.onTouchEnd(e)},this.scrollResponderHandleResponderRelease=e=>{this.props.onResponderRelease&&this.props.onResponderRelease(e);var o=u.default.currentlyFocusedField();this.props.keyboardShouldPersistTaps||null==o||e.target===o||this.observedScrollSinceBecomingResponder||this.becameResponderWhileAnimating||(this.props.onScrollResponderKeyboardDismissed&&this.props.onScrollResponderKeyboardDismissed(e),u.default.blurTextInput(o))},this.scrollResponderHandleScroll=e=>{this.observedScrollSinceBecomingResponder=!0,this.props.onScroll&&this.props.onScroll(e)},this.scrollResponderHandleResponderGrant=e=>{this.observedScrollSinceBecomingResponder=!1,this.props.onResponderGrant&&this.props.onResponderGrant(e),this.becameResponderWhileAnimating=this.scrollResponderIsAnimating()},this.scrollResponderHandleScrollBeginDrag=e=>{this.props.onScrollBeginDrag&&this.props.onScrollBeginDrag(e)},this.scrollResponderHandleScrollEndDrag=e=>{this.props.onScrollEndDrag&&this.props.onScrollEndDrag(e)},this.scrollResponderHandleMomentumScrollBegin=e=>{this.lastMomentumScrollBeginTime=Date.now(),this.props.onMomentumScrollBegin&&this.props.onMomentumScrollBegin(e)},this.scrollResponderHandleMomentumScrollEnd=e=>{this.lastMomentumScrollEndTime=Date.now(),this.props.onMomentumScrollEnd&&this.props.onMomentumScrollEnd(e)},this.scrollResponderHandleTouchStart=e=>{this.isTouching=!0,this.props.onTouchStart&&this.props.onTouchStart(e)},this.scrollResponderHandleTouchMove=e=>{this.props.onTouchMove&&this.props.onTouchMove(e)},this.scrollResponderIsAnimating=()=>Date.now()-this.lastMomentumScrollEndTime<16||this.lastMomentumScrollEndTime{if('number'==typeof e)console.warn('`scrollResponderScrollTo(x, y, animated)` is deprecated. Use `scrollResponderScrollTo({x: 5, y: 5, animated: true})` instead.');else{var n=e||b;e=n.x,o=n.y,l=n.animated}var t=this.getScrollableNode(),s=e||0,i=o||0;null!=t&&('function'==typeof t.scroll?t.scroll({top:i,left:s,behavior:l?'smooth':'auto'}):(t.scrollLeft=s,t.scrollTop=i))},this.scrollResponderZoomTo=(e,o)=>{(0,i.default)('zoomToRect is not implemented')},this.scrollResponderScrollNativeHandleToKeyboard=(e,o,l)=>{this.additionalScrollOffset=o||0,this.preventNegativeScrollOffset=!!l,S.default.measureLayout(e,this.getInnerViewNode(),this.scrollResponderTextInputFocusError,this.scrollResponderInputMeasureAndScrollToKeyboard)},this.scrollResponderInputMeasureAndScrollToKeyboard=(e,o,l,n)=>{var s=t.default.get('window').height;this.keyboardWillOpenTo&&(s=this.keyboardWillOpenTo.endCoordinates.screenY);var i=o-s+n+this.additionalScrollOffset;this.preventNegativeScrollOffset&&(i=Math.max(0,i)),this.scrollResponderScrollTo({x:0,y:i,animated:!0}),this.additionalOffset=0,this.preventNegativeScrollOffset=!1},this.scrollResponderKeyboardWillShow=e=>{this.keyboardWillOpenTo=e,this.props.onKeyboardWillShow&&this.props.onKeyboardWillShow(e)},this.scrollResponderKeyboardWillHide=e=>{this.keyboardWillOpenTo=null,this.props.onKeyboardWillHide&&this.props.onKeyboardWillHide(e)},this.scrollResponderKeyboardDidShow=e=>{e&&(this.keyboardWillOpenTo=e),this.props.onKeyboardDidShow&&this.props.onKeyboardDidShow(e)},this.scrollResponderKeyboardDidHide=e=>{this.keyboardWillOpenTo=null,this.props.onKeyboardDidHide&&this.props.onKeyboardDidHide(e)},this.flashScrollIndicators=()=>{this.scrollResponderFlashScrollIndicators()},this.getScrollResponder=()=>this,this.getScrollableNode=()=>this._scrollNodeRef,this.getInnerViewRef=()=>this._innerViewRef,this.getInnerViewNode=()=>this._innerViewRef,this.getNativeScrollRef=()=>this._scrollNodeRef,this.scrollTo=(e,o,l)=>{if('number'==typeof e)console.warn('`scrollTo(y, x, animated)` is deprecated. Use `scrollTo({x: 5, y: 5, animated: true})` instead.');else{var n=e||b;o=n.x,e=n.y,l=n.animated}this.scrollResponderScrollTo({x:o||0,y:e||0,animated:!1!==l})},this.scrollToEnd=e=>{var o=!1!==(e&&e.animated),l=this.props.horizontal,n=this.getScrollableNode(),t=l?n.scrollWidth:0,s=l?0:n.scrollHeight;this.scrollResponderScrollTo({x:t,y:s,animated:o})},this._handleContentOnLayout=e=>{var o=e.nativeEvent.layout,l=o.width,n=o.height;this.props.onContentSizeChange(l,n)},this._handleScroll=e=>{'on-drag'===this.props.keyboardDismissMode&&(0,s.default)(),this.scrollResponderHandleScroll(e)},this._setInnerViewRef=e=>{this._innerViewRef=e},this._setScrollNodeRef=e=>{this._scrollNodeRef=e,null!=e&&(e.getScrollResponder=this.getScrollResponder,e.getInnerViewNode=this.getInnerViewNode,e.getInnerViewRef=this.getInnerViewRef,e.getNativeScrollRef=this.getNativeScrollRef,e.getScrollableNode=this.getScrollableNode,e.scrollTo=this.scrollTo,e.scrollToEnd=this.scrollToEnd,e.flashScrollIndicators=this.flashScrollIndicators,e.scrollResponderZoomTo=this.scrollResponderZoomTo,e.scrollResponderScrollNativeHandleToKeyboard=this.scrollResponderScrollNativeHandleToKeyboard),(0,c.default)(this.props.forwardedRef)(e)}}scrollResponderHandleStartShouldSetResponder(){return!1}scrollResponderHandleResponderReject(){(0,y.default)(!1,"ScrollView doesn't take rejection well - scrolls anyway")}scrollResponderFlashScrollIndicators(){}scrollResponderTextInputFocusError(e){console.error('Error measuring text field: ',e)}render(){var e=this.props,t=e.contentContainerStyle,s=e.horizontal,c=e.onContentSizeChange,p=e.refreshControl,u=e.stickyHeaderIndices,S=e.pagingEnabled,y=(e.forwardedRef,e.keyboardDismissMode,e.onScroll,e.centerContent),b=(0,n.default)(e,T),v={};c&&(v={onLayout:this._handleContentOnLayout});var H=!s&&Array.isArray(u),E=H||S?f.default.Children.map(this.props.children,((e,o)=>{var l=H&&u.indexOf(o)>-1;return null!=e&&(l||S)?f.default.createElement(R.default,{style:[l&&w.stickyHeader,S&&w.pagingEnabledChild]},e):e})):this.props.children,C=f.default.createElement(R.default,(0,l.default)({},v,{children:E,collapsable:!1,ref:this._setInnerViewRef,style:[s&&w.contentContainerHorizontal,y&&w.contentContainerCenterContent,t]})),M=s?w.baseHorizontal:w.baseVertical,D=s?w.pagingEnabledHorizontal:w.pagingEnabledVertical,I=(0,o.default)((0,o.default)({},b),{},{style:[M,S&&D,this.props.style],onTouchStart:this.scrollResponderHandleTouchStart,onTouchMove:this.scrollResponderHandleTouchMove,onTouchEnd:this.scrollResponderHandleTouchEnd,onScrollBeginDrag:this.scrollResponderHandleScrollBeginDrag,onScrollEndDrag:this.scrollResponderHandleScrollEndDrag,onMomentumScrollBegin:this.scrollResponderHandleMomentumScrollBegin,onMomentumScrollEnd:this.scrollResponderHandleMomentumScrollEnd,onStartShouldSetResponder:this.scrollResponderHandleStartShouldSetResponder,onStartShouldSetResponderCapture:this.scrollResponderHandleStartShouldSetResponderCapture,onScrollShouldSetResponder:this.scrollResponderHandleScrollShouldSetResponder,onScroll:this._handleScroll,onResponderGrant:this.scrollResponderHandleResponderGrant,onResponderTerminationRequest:this.scrollResponderHandleTerminationRequest,onResponderTerminate:this.scrollResponderHandleTerminate,onResponderRelease:this.scrollResponderHandleResponderRelease,onResponderReject:this.scrollResponderHandleResponderReject}),N=h.default;(0,i.default)(void 0!==N,'ScrollViewClass must not be undefined');var x=f.default.createElement(N,(0,l.default)({},I,{ref:this._setScrollNodeRef}),C);return p?f.default.cloneElement(p,{style:I.style},x):x}}var H={flexGrow:1,flexShrink:1,transform:'translateZ(0)',WebkitOverflowScrolling:'touch'},w=p.default.create({baseVertical:(0,o.default)((0,o.default)({},H),{},{flexDirection:'column',overflowX:'hidden',overflowY:'auto'}),baseHorizontal:(0,o.default)((0,o.default)({},H),{},{flexDirection:'row',overflowX:'auto',overflowY:'hidden'}),contentContainerHorizontal:{flexDirection:'row'},contentContainerCenterContent:{justifyContent:'center',flexGrow:1},stickyHeader:{position:'sticky',top:0,zIndex:10},pagingEnabledHorizontal:{scrollSnapType:'x mandatory'},pagingEnabledVertical:{scrollSnapType:'y mandatory'},pagingEnabledChild:{scrollSnapAlign:'start'}}),E=f.default.forwardRef(((e,o)=>f.default.createElement(v,(0,l.default)({},e,{forwardedRef:o}))));E.displayName='ScrollView';_e.default=E}),250,[1,5,19,28,135,251,10,111,77,253,27,252,105,122,14,254]); -__d((function(g,r,i,a,m,e,d){var u=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=u(r(d[1]));e.default=()=>{t.default.blurTextInput(t.default.currentlyFocusedField())}}),251,[1,252]); -__d((function(g,r,i,a,m,e,d){var u=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=u(r(d[1])),l={_currentlyFocusedNode:null,currentlyFocusedField(){return document.activeElement!==this._currentlyFocusedNode&&(this._currentlyFocusedNode=null),this._currentlyFocusedNode},focusTextInput(u){null!==u&&(this._currentlyFocusedNode=u,document.activeElement!==u&&t.default.focus(u))},blurTextInput(u){null!==u&&(this._currentlyFocusedNode=null,document.activeElement===u&&t.default.blur(u))}};e.default=l}),252,[1,105]); -__d((function(g,_r,_i,_a,m,_e,d){var e=_r(d[0]);Object.defineProperty(_e,"__esModule",{value:!0}),_e.default=void 0;var t=e(_r(d[1])),r=e(_r(d[2])),o=(function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=a(t);if(r&&r.has(e))return r.get(e);var o={__proto__:null},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in e)if("default"!==l&&{}.hasOwnProperty.call(e,l)){var c=n?Object.getOwnPropertyDescriptor(e,l):null;c&&(c.get||c.set)?Object.defineProperty(o,l,c):o[l]=e[l]}return o.default=e,r&&r.set(e,o),o})(_r(d[3])),n=e(_r(d[4])),l=e(_r(d[5])),c=e(_r(d[6]));function a(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(a=function(e){return e?r:t})(e)}var i=["onScroll","onTouchMove","onWheel","scrollEnabled","scrollEventThrottle","showsHorizontalScrollIndicator","showsVerticalScrollIndicator","style"];function u(e){return{nativeEvent:{contentOffset:{get x(){return e.target.scrollLeft},get y(){return e.target.scrollTop}},contentSize:{get height(){return e.target.scrollHeight},get width(){return e.target.scrollWidth}},layoutMeasurement:{get height(){return e.target.offsetHeight},get width(){return e.target.offsetWidth}}},timeStamp:Date.now()}}var s=o.forwardRef(((e,n)=>{var a=e.onScroll,s=e.onTouchMove,h=e.onWheel,v=e.scrollEnabled,p=void 0===v||v,w=e.scrollEventThrottle,S=void 0===w?0:w,y=e.showsHorizontalScrollIndicator,b=e.showsVerticalScrollIndicator,T=e.style,_=(0,r.default)(e,i),M=o.useRef({isScrolling:!1,scrollLastTick:0}),O=o.useRef(null),W=o.useRef(null);function D(e){return t=>{p&&e&&e(t)}}function P(e){M.current.isScrolling=!0,j(e)}function j(e){M.current.scrollLastTick=Date.now(),a&&a(u(e))}function k(e){M.current.isScrolling=!1,a&&a(u(e))}var E=!1===y||!1===b;return o.createElement(l.default,(0,t.default)({},_,{onScroll:function(e){var t,r,o;e.stopPropagation(),e.target===W.current&&(e.persist(),null!=O.current&&clearTimeout(O.current),O.current=setTimeout((()=>{k(e)}),100),M.current.isScrolling?(t=M.current.scrollLastTick,r=S,o=Date.now()-t,r>0&&o>=r&&j(e)):P(e))},onTouchMove:D(s),onWheel:D(h),ref:(0,c.default)(W,n),style:[T,!p&&f.scrollDisabled,E&&f.hideScrollbar]}))})),f=n.default.create({scrollDisabled:{overflowX:'hidden',overflowY:'hidden',touchAction:'none'},hideScrollbar:{scrollbarWidth:'none'}});_e.default=s}),253,[1,19,28,14,27,122,110]); -__d((function(g,r,i,a,m,e,d){'use strict';var t=r(d[0]);m.exports=t}),254,[255]); -__d((function(g,r,i,a,m,e,d){"use strict";function t(t){return function(){return t}}var n=function(){};n.thatReturns=t,n.thatReturnsFalse=t(!1),n.thatReturnsTrue=t(!0),n.thatReturnsNull=t(null),n.thatReturnsThis=function(){return this},n.thatReturnsArgument=function(t){return t},m.exports=n}),255,[]); -__d((function(g,r,i,a,m,_e,d){Object.defineProperty(_e,"__esModule",{value:!0}),_e.default=void 0;_e.default=e=>{var t;try{t=(0,r(d[0]).findDOMNode)(e)}catch(e){}return t}}),256,[12]); -__d((function(g,r,i,a,m,e,d){'use strict';var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var s=t(r(d[1]));e.default=class{constructor(t,s){this._delay=s,this._callback=t}dispose(t){void 0===t&&(t={abort:!1}),this._taskHandle&&(this._taskHandle.cancel(),t.abort||this._callback(),this._taskHandle=null)}schedule(){if(!this._taskHandle){var t=setTimeout((()=>{this._taskHandle=s.default.runAfterInteractions((()=>{this._taskHandle=null,this._callback()}))}),this._delay);this._taskHandle={cancel:()=>clearTimeout(t)}}}}}),257,[1,258]); -__d((function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=t(r(d[1])),o=t(r(d[2])),s=t(r(d[3])),c=t(r(d[4])),l=new s.default,u={Events:{interactionStart:'interactionStart',interactionComplete:'interactionComplete'},runAfterInteractions(t){var n=[],o=new Promise((o=>{b(),t&&n.push(t),n.push({run:o,name:'resolve '+(t&&t.name||'?')}),p.enqueueTasks(n)}));return{then:o.then.bind(o),done:o.then.bind(o),cancel:()=>{p.cancelTasks(n)}}},createInteractionHandle(){b();var t=++S;return v.add(t),t},clearInteractionHandle(t){(0,n.default)(!!t,'Must provide a handle to clear.'),b(),v.delete(t),h.add(t)},addListener:l.addListener.bind(l),setDeadline(t){T=t}},f=new Set,v=new Set,h=new Set,p=new o.default({onMoreTasks:b}),w=0,S=0,T=-1;function b(){w||(w=T>0?setTimeout(k):(0,c.default)(k))}function k(){w=0;var t=f.size;v.forEach((t=>f.add(t))),h.forEach((t=>f.delete(t)));var n=f.size;if(0!==t&&0===n?l.emit(u.Events.interactionComplete):0===t&&0!==n&&l.emit(u.Events.interactionStart),0===n)for(var o=Date.now();p.hasTasksToProcess();)if(p.processNext(),T>0&&Date.now()-o>=T){b();break}v.clear(),h.clear()}e.default=u}),258,[1,10,259,260,261]); -__d((function(g,r,i,a,m,_e,d){var e=r(d[0]);Object.defineProperty(_e,"__esModule",{value:!0}),_e.default=void 0;var t=e(r(d[1])),s=e(r(d[2]));_e.default=class{constructor(e){var t=e.onMoreTasks;this._onMoreTasks=t,this._queueStack=[{tasks:[],popable:!0}]}enqueue(e){this._getCurrentQueue().push(e)}enqueueTasks(e){e.forEach((e=>this.enqueue(e)))}cancelTasks(e){this._queueStack=this._queueStack.map((s=>(0,t.default)((0,t.default)({},s),{},{tasks:s.tasks.filter((t=>-1===e.indexOf(t)))}))).filter(((e,t)=>e.tasks.length>0||0===t))}hasTasksToProcess(){return this._getCurrentQueue().length>0}processNext(){var e=this._getCurrentQueue();if(e.length){var t=e.shift();try{'object'==typeof t&&t.gen?this._genPromise(t):'object'==typeof t&&t.run?t.run():((0,s.default)('function'==typeof t,'Expected Function, SimpleTask, or PromiseTask, but got:\n'+JSON.stringify(t,null,2)),t())}catch(e){throw e.message='TaskQueue: Error with task '+(t.name||'')+': '+e.message,e}}}_getCurrentQueue(){var e=this._queueStack.length-1,t=this._queueStack[e];return t.popable&&0===t.tasks.length&&e>0?(this._queueStack.pop(),this._getCurrentQueue()):t.tasks}_genPromise(e){var t=this._queueStack.push({tasks:[],popable:!1})-1,s=this._queueStack[t];e.gen().then((()=>{s.popable=!0,this.hasTasksToProcess()&&this._onMoreTasks()})).catch((t=>{setTimeout((()=>{throw t.message="TaskQueue: Error resolving Promise in task "+e.name+": "+t.message,t}),0)}))}}}),259,[1,5,10]); -__d((function(g,r,i,a,m,e,d){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;function t(t,n){var l=t[n];return null==l&&(l=new Set,t[n]=l),l}e.default=class{constructor(){this._registry={}}addListener(n,l,s){var u=t(this._registry,n),o={context:s,listener:l,remove(){u.delete(o)}};return u.add(o),o}emit(t){var n=this._registry[t];if(null!=n){for(var l=arguments.length,s=new Array(l>1?l-1:0),u=1;u{var t=Date.now();l({didTimeout:!1,timeRemaining:()=>Math.max(0,50-(Date.now()-t))})}),1)};e.cancelIdleCallback=t?window.cancelIdleCallback:function(l){clearTimeout(l)},e.default=n}),261,[1,23]); -__d((function(g,r,i,a,m,e,d){'use strict';Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;e.default=function(t,u,n){return un?n:u}}),262,[]); -__d((function(g,r,i,a,m,e,d){'use strict';Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;e.default=function(){return console.log(...arguments)}}),263,[]); -__d((function(g,r,i,a,m,e,d){var l=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=l(r(d[1])),n=l(r(d[2]));e.default=class{constructor(){this._cellKeyToChildren=new Map,this._childrenToCellKey=new Map}add(l,t){var o;(0,n.default)(!this._childrenToCellKey.has(l),'Trying to add already present child list');var h=null!==(o=this._cellKeyToChildren.get(t))&&void 0!==o?o:new Set;h.add(l),this._cellKeyToChildren.set(t,h),this._childrenToCellKey.set(l,t)}remove(l){var t=this._childrenToCellKey.get(l);(0,n.default)(null!=t,'Trying to remove non-present child list'),this._childrenToCellKey.delete(l);var o=this._cellKeyToChildren.get(t);(0,n.default)(o,'_cellKeyToChildren should contain cellKey'),o.delete(l),0===o.size&&this._cellKeyToChildren.delete(t)}forEach(l){for(var n,o=(0,t.default)(this._cellKeyToChildren.values());!(n=o()).done;)for(var h,s=n.value,c=(0,t.default)(s);!(h=c()).done;){l(h.value)}}forEachInCell(l,n){for(var o,h,s=null!==(o=this._cellKeyToChildren.get(l))&&void 0!==o?o:[],c=(0,t.default)(s);!(h=c()).done;){n(h.value)}}anyInCell(l,n){for(var o,h,s=null!==(o=this._cellKeyToChildren.get(l))&&void 0!==o?o:[],c=(0,t.default)(s);!(h=c()).done;){if(n(h.value))return!0}return!1}size(){return this._childrenToCellKey.size}}}),264,[1,246,10]); -__d((function(g,r,i,a,m,e,d){'use strict';var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var s=t(r(d[1]));class l{constructor(){this.any_blank_count=0,this.any_blank_ms=0,this.any_blank_speed_sum=0,this.mostly_blank_count=0,this.mostly_blank_ms=0,this.pixels_blank=0,this.pixels_sampled=0,this.pixels_scrolled=0,this.total_time_spent=0,this.sample_count=0}}var n=[],_=10,h=null;e.default=class{static addListener(t){return null===h&&console.warn('Call `FillRateHelper.setSampleRate` before `addListener`.'),n.push(t),{remove:()=>{n=n.filter((s=>t!==s))}}}static setSampleRate(t){h=t}static setMinSampleCount(t){_=t}constructor(t){this._anyBlankStartTime=null,this._enabled=!1,this._info=new l,this._mostlyBlankStartTime=null,this._samplesStartTime=null,this._getFrameMetrics=t,this._enabled=(h||0)>Math.random(),this._resetData()}activate(){this._enabled&&null==this._samplesStartTime&&(this._samplesStartTime=g.performance.now())}deactivateAndFlush(){if(this._enabled){var t=this._samplesStartTime;if(null!=t)if(this._info.sample_count<_)this._resetData();else{var l=g.performance.now()-t,h=(0,s.default)((0,s.default)({},this._info),{},{total_time_spent:l});n.forEach((t=>t(h))),this._resetData()}}}computeBlankness(t,s,l){if(!this._enabled||0===t.getItemCount(t.data)||s.last0&&(c=Math.min(o,Math.max(0,y.offset-_)));for(var b=0,k=s.last,S=this._getFrameMetrics(k,t);k>=s.first&&(!S||!S.inLayout);)S=this._getFrameMetrics(k,t),k--;if(S&&k0?(this._anyBlankStartTime=f,this._info.any_blank_speed_sum+=u,this._info.any_blank_count++,this._info.pixels_blank+=M,T>.5&&(this._mostlyBlankStartTime=f,this._info.mostly_blank_count++)):(u<.01||Math.abs(n)<1)&&this.deactivateAndFlush(),T}enabled(){return this._enabled}_resetData(){this._anyBlankStartTime=null,this._info=new l,this._mostlyBlankStartTime=null,this._samplesStartTime=null}}}),265,[1,5]); -__d((function(g,_r,_i,_a,m,_e,d){var t=_r(d[0]);Object.defineProperty(_e,"__esModule",{value:!0}),_e.default=void 0;var e=t(_r(d[1])),r=(function(t,e){if(!e&&t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var r=n(e);if(r&&r.has(t))return r.get(t);var s={__proto__:null},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in t)if("default"!==o&&{}.hasOwnProperty.call(t,o)){var i=a?Object.getOwnPropertyDescriptor(t,o):null;i&&(i.get||i.set)?Object.defineProperty(s,o,i):s[o]=t[o]}return s.default=t,r&&r.set(t,s),s})(_r(d[2]));function n(t){if("function"!=typeof WeakMap)return null;var e=new WeakMap,r=new WeakMap;return(n=function(t){return t?r:e})(t)}class s extends r.PureComponent{constructor(t){super(t),this._inAsyncStateUpdate=!1,this._installSetStateHooks()}setState(t,e){'function'==typeof t?super.setState(((e,r)=>{var n;this._inAsyncStateUpdate=!0;try{n=t(e,r)}catch(t){throw t}finally{this._inAsyncStateUpdate=!1}return n}),e):super.setState(t,e)}_installSetStateHooks(){var t=this,r=this.props,n=this.state;Object.defineProperty(this,'props',{get:()=>((0,e.default)(!t._inAsyncStateUpdate,'"this.props" should not be accessed during state updates'),r),set(t){r=t}}),Object.defineProperty(this,'state',{get:()=>((0,e.default)(!t._inAsyncStateUpdate,'"this.state" should not be acceessed during state updates'),n),set(t){n=t}})}}_e.default=s}),266,[1,10,14]); -__d((function(g,r,i,a,m,e,d){'use strict';var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=t(r(d[1])),s=t(r(d[2])),l=t(r(d[3]));function o(t,n,s,l,o,u){if(c(s,l,o))return!0;var v=h(s,l,o);return 100*(t?v/o:v/u)>=n}function h(t,n,s){var l=Math.min(n,s)-Math.max(t,0);return Math.max(0,l)}function c(t,n,s){return t>=0&&n<=s&&n>t}e.default=class{constructor(t){void 0===t&&(t={viewAreaCoveragePercentThreshold:0}),this._hasInteracted=!1,this._timers=new Set,this._viewableIndices=[],this._viewableItems=new Map,this._config=t}dispose(){this._timers.forEach(clearTimeout)}computeViewableItems(t,n,s,h,c){var u=t.getItemCount(t.data),v=this._config,f=v.itemVisiblePercentThreshold,_=v.viewAreaCoveragePercentThreshold,w=null!=_,I=w?_:f;(0,l.default)(null!=I&&null!=f!=(null!=_),'Must set exactly one of itemVisiblePercentThreshold or viewAreaCoveragePercentThreshold');var b=[];if(0===u)return b;var p=-1,y=c||{first:0,last:u-1},T=y.first,V=y.last;if(V>=u)return console.warn('Invalid render range computing viewability '+JSON.stringify({renderRange:c,itemCount:u})),[];for(var C=T;C<=V;C++){var M=h(C,t);if(M){var P=M.offset-n,S=P+M.length;if(P0)p=C,o(w,I,P,S,s,M.length)&&b.push(C);else if(p>=0)break}}return b}onUpdate(t,n,s,l,o,h,c){var u=t.getItemCount(t.data);if((!this._config.waitForInteraction||this._hasInteracted)&&0!==u&&l(0,t)){var v=[];if(u&&(v=this.computeViewableItems(t,n,s,l,c)),this._viewableIndices.length!==v.length||!this._viewableIndices.every(((t,n)=>t===v[n])))if(this._viewableIndices=v,this._config.minimumViewTime){var f=setTimeout((()=>{this._timers.delete(f),this._onUpdateSync(t,v,h,o)}),this._config.minimumViewTime);this._timers.add(f)}else this._onUpdateSync(t,v,h,o)}}resetViewableIndices(){this._viewableIndices=[]}recordInteraction(){this._hasInteracted=!0}_onUpdateSync(t,l,o,h){l=l.filter((t=>this._viewableIndices.includes(t)));for(var c,u=this._viewableItems,v=new Map(l.map((n=>{var s=h(n,!0,t);return[s.key,s]}))),f=[],_=(0,s.default)(v);!(c=_()).done;){var w=c.value,I=w[0],b=w[1];u.has(I)||f.push(b)}for(var p,y=(0,s.default)(u);!(p=y()).done;){var T=p.value,V=T[0],C=T[1];v.has(V)||f.push((0,n.default)((0,n.default)({},C),{},{isViewable:!1}))}f.length>0&&(this._viewableItems=v,o({viewableItems:Array.from(v.values()),changed:f,viewabilityConfig:this._config}))}}}),267,[1,5,246,10]); -__d((function(g,_r,_i,_a,m,_e,d){var e=_r(d[0]);Object.defineProperty(_e,"__esModule",{value:!0}),_e.default=void 0;var t=e(_r(d[1])),r=e(_r(d[2])),o=e(_r(d[3])),n=e(_r(d[4])),a=e(_r(d[5])),s=(function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=i(t);if(r&&r.has(e))return r.get(e);var o={__proto__:null},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&{}.hasOwnProperty.call(e,a)){var s=n?Object.getOwnPropertyDescriptor(e,a):null;s&&(s.get||s.set)?Object.defineProperty(o,a,s):o[a]=e[a]}return o.default=e,r&&r.set(e,o),o})(_r(d[6]));function i(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(i=function(e){return e?r:t})(e)}class l extends s.Component{constructor(){super(...arguments),this.state={separatorProps:{highlighted:!1,leadingItem:this.props.item}},this._separators={highlight:()=>{var e=this.props,t=e.cellKey,r=e.prevCellKey;this.props.onUpdateSeparators([t,r],{highlighted:!0})},unhighlight:()=>{var e=this.props,t=e.cellKey,r=e.prevCellKey;this.props.onUpdateSeparators([t,r],{highlighted:!1})},updateProps:(e,t)=>{var r=this.props,o=r.cellKey,n=r.prevCellKey;this.props.onUpdateSeparators(['leading'===e?n:o],t)}},this._onLayout=e=>{this.props.onCellLayout&&this.props.onCellLayout(e,this.props.cellKey,this.props.index)}}static getDerivedStateFromProps(e,t){return{separatorProps:(0,r.default)((0,r.default)({},t.separatorProps),{},{leadingItem:e.item})}}updateSeparatorProps(e){this.setState((t=>({separatorProps:(0,r.default)((0,r.default)({},t.separatorProps),e)})))}componentWillUnmount(){this.props.onUnmount(this.props.cellKey)}_renderElement(e,t,r,o){return e&&t&&console.warn("VirtualizedList: Both ListItemComponent and renderItem props are present. ListItemComponent will take precedence over renderItem."),t?s.createElement(t,{item:r,index:o,separators:this._separators}):e?e({item:r,index:o,separators:this._separators}):void(0,a.default)(!1,'VirtualizedList: Either ListItemComponent or renderItem props are required but none were found.')}render(){var e=this.props,r=e.CellRendererComponent,n=e.ItemSeparatorComponent,a=e.ListItemComponent,i=e.cellKey,l=e.horizontal,u=e.item,c=e.index,h=e.inversionStyle,f=e.onCellFocusCapture,y=e.onCellLayout,v=e.renderItem,C=this._renderElement(v,a,u,c),_=s.isValidElement(n)?n:n&&s.createElement(n,this.state.separatorProps),P=h?l?[p.rowReverse,h]:[p.columnReverse,h]:l?[p.row,h]:h,L=r?s.createElement(r,(0,t.default)({cellKey:i,index:c,item:u,style:P,onFocusCapture:f},y&&{onLayout:this._onLayout}),C,_):s.createElement(o.default,(0,t.default)({style:P,onFocusCapture:f},y&&{onLayout:this._onLayout}),C,_);return s.createElement(_r(d[7]).VirtualizedListCellContextProvider,{cellKey:this.props.cellKey},L)}}_e.default=l;var p=n.default.create({row:{flexDirection:'row'},rowReverse:{flexDirection:'row-reverse'},columnReverse:{flexDirection:'column-reverse'}})}),268,[1,19,5,122,27,10,14,269]); -__d((function(g,_r,_i,_a,m,_e,d){var e=_r(d[0]);Object.defineProperty(_e,"__esModule",{value:!0}),_e.VirtualizedListCellContextProvider=function(e){var l=e.cellKey,u=e.children,o=(0,r.useContext)(i),a=(0,r.useMemo)((()=>null==o?null:(0,t.default)((0,t.default)({},o),{},{cellKey:l})),[o,l]);return n.createElement(i.Provider,{value:a},u)},_e.VirtualizedListContext=void 0,_e.VirtualizedListContextProvider=function(e){var t=e.children,l=e.value,u=(0,r.useMemo)((()=>({cellKey:null,getScrollMetrics:l.getScrollMetrics,horizontal:l.horizontal,getOutermostParentListRef:l.getOutermostParentListRef,registerAsNestedChild:l.registerAsNestedChild,unregisterAsNestedChild:l.unregisterAsNestedChild})),[l.getScrollMetrics,l.horizontal,l.getOutermostParentListRef,l.registerAsNestedChild,l.unregisterAsNestedChild]);return n.createElement(i.Provider,{value:u},t)},_e.VirtualizedListContextResetter=function(e){var t=e.children;return n.createElement(i.Provider,{value:null},t)};var t=e(_r(d[1])),r=(function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=l(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&{}.hasOwnProperty.call(e,u)){var o=i?Object.getOwnPropertyDescriptor(e,u):null;o&&(o.get||o.set)?Object.defineProperty(n,u,o):n[u]=e[u]}return n.default=e,r&&r.set(e,n),n})(_r(d[2])),n=r;function l(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(l=function(e){return e?r:t})(e)}var i=_e.VirtualizedListContext=n.createContext(null)}),269,[1,5,14]); -__d((function(g,r,i,a,m,e,d){'use strict';function t(t,o){if(null!=t)return t;var n=new Error(void 0!==o?o:'Got unexpected '+t);throw n.framesToPop=1,n}m.exports=t,m.exports.default=t,Object.defineProperty(m.exports,'__esModule',{value:!0})}),270,[]); -__d((function(g,r,_i,a,m,e,d){var s=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.CellRenderMask=void 0;var t=s(r(d[1])),i=s(r(d[2]));e.CellRenderMask=class{constructor(s){(0,i.default)(s>=0,'CellRenderMask must contain a non-negative number os cells'),this._numCells=s,this._regions=0===s?[]:[{first:0,last:s-1,isSpacer:!0}]}enumerateRegions(){return this._regions}addCells(s){if((0,i.default)(s.first>=0&&s.first=-1&&s.last=s.first-1,'CellRenderMask.addCells called with invalid cell range'),!(s.lastp.last&&(u.isSpacer?h.push({first:p.last+1,last:u.last,isSpacer:!0}):p.last=u.last);var C=[...c,p,...h],v=_-f+1;this._regions.splice(f,v,...C)}}}numCells(){return this._numCells}equals(s){return this._numCells===s._numCells&&this._regions.length===s._regions.length&&this._regions.every(((t,i)=>t.first===s._regions[i].first&&t.last===s._regions[i].last&&t.isSpacer===s._regions[i].isSpacer))}_findRegion(s){for(var t=0,l=this._regions.length-1;t<=l;){var n=Math.floor((t+l)/2),f=this._regions[n];if(s>=f.first&&s<=f.last)return[f,n];sf.last&&(t=n+1)}(0,i.default)(!1,"A region was not found containing cellIdx "+s)}}}),271,[1,5,10]); -__d((function(g,r,i,a,m,e,d){'use strict';function t(t,n,f,o){void 0===o&&(o=1);for(var s=n.getItemCount(n.data),l=[],u=0;u>>1),b=f(M,n),x=b.offset*o,y=(b.offset+b.length)*o;if(0===M&&vy)){l[u]=M;break}c=M+1}}return l}function n(t,n){return n.last-n.first+1-Math.max(0,1+Math.min(n.last,t.last)-Math.max(n.first,t.first))}Object.defineProperty(e,"__esModule",{value:!0}),e.computeWindowedRenderLimits=function(f,o,s,l,u,v){var c=f.getItemCount(f.data);if(0===c)return{first:0,last:-1};var h=v.offset,M=v.velocity,b=v.visibleLength,x=v.zoomScale,y=void 0===x?1:x,w=Math.max(0,h),k=w+b,p=(s-1)*b,C=M>1?'after':M<-1?'before':'none',O=Math.max(0,w-.5*p),_=Math.max(0,k+.5*p);if(u(c-1,f).offset*y=I);){var B=z>=o,F=S<=l.first||S>l.last,J=S>L&&(!B||!F),N=E>=l.last||E=S&&S>=0&&E=L&&E<=I&&S<=R.first&&E>=R.last))throw new Error('Bad window calculation '+JSON.stringify({first:S,last:E,itemCount:c,overscanFirst:L,overscanLast:I,visible:R}));return{first:S,last:E}},e.elementsThatOverlapOffsets=t,e.keyExtractor=function(t,n){if('object'==typeof t&&null!=(null==t?void 0:t.key))return t.key;if('object'==typeof t&&null!=(null==t?void 0:t.id))return t.id;return String(n)},e.newRangeCount=n}),272,[]); -__d((function(g,r,_i2,a,m,e,d){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,u){void 0===u&&(u=n);var l=null;function i(){for(var n=[],i=0;i{var i=(0,n.default)(f),c=i[0],p=i[1],s=(0,u.default)(p,o),y=c.passthroughAnimatedPropExplicitValues,v=c.style,_=null!=y?y:{},O=_.style,P=(0,r.default)(_,l),b=[v,O];return a.createElement(e,(0,t.default)({},c,P,{style:b,ref:s}))}))};var t=e(_r(d[1])),r=e(_r(d[2])),n=e(_r(d[3])),u=e(_r(d[4])),a=(e(_r(d[5])),e(_r(d[6])),(function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=f(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&{}.hasOwnProperty.call(e,a)){var l=u?Object.getOwnPropertyDescriptor(e,a):null;l&&(l.get||l.set)?Object.defineProperty(n,a,l):n[a]=e[a]}return n.default=e,r&&r.set(e,n),n})(_r(d[7])));function f(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(f=function(e){return e?r:t})(e)}var l=["style"]}),274,[1,19,28,275,293,27,122,14]); -__d((function(g,r,i,a,m,e,d){'use strict';var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){var u=(0,f.useReducer)((t=>t+1),0)[1],c=(0,f.useRef)(null),o=(0,f.useMemo)((()=>new n.default(t,(()=>null==c.current?void 0:c.current()))),[t]);s(o);var h=(0,f.useCallback)((n=>{o.setNativeView(n),c.current=()=>{u()};var l=v(n),f=[];for(var _ in t){var s=t[_];s instanceof r(d[7]).AnimatedEvent&&s.__isNative&&(s.__attach(l,_),f.push([_,s]))}return()=>{c.current=null;for(var t=0,u=f;t{c.default.API.flushQueue()})),(0,o.default)((()=>(n.current=!1,()=>{n.current=!0})),[]),(0,o.default)((()=>{if(t.__attach(),null!=u.current){var l=u.current;l.__restoreDefaultValues(),l.__detach(),u.current=null}return()=>{n.current?t.__detach():u.current=t}}),[t])}function v(t){return'object'==typeof t&&'function'==typeof(null==t?void 0:t.getScrollableNode)?t.getScrollableNode():t}}),275,[1,5,276,292,278,14,104,289]); -__d((function(g,r,i,a,m,e,d){'use strict';var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var _=t(r(d[1])),s=t(r(d[2])),n=t(r(d[3])),o=t(r(d[4])),l=t(r(d[5]));class h extends s.default{constructor(t,s){super(),t.style&&(t=(0,_.default)((0,_.default)({},t),{},{style:new n.default(t.style)})),this._props=t,this._callback=s,this.__attach()}__getValue(){var t={};for(var _ in this._props){var o=this._props[_];o instanceof s.default?(!o.__isNative||o instanceof n.default)&&(t[_]=o.__getValue()):o instanceof r(d[6]).AnimatedEvent?t[_]=o.__getHandler():t[_]=o}return t}__getAnimatedValue(){var t={};for(var _ in this._props){var n=this._props[_];n instanceof s.default&&(t[_]=n.__getAnimatedValue())}return t}__attach(){for(var t in this._props){var _=this._props[t];_ instanceof s.default&&_.__addChild(this)}}__detach(){for(var t in this.__isNative&&this._animatedView&&this.__disconnectAnimatedView(),this._props){var _=this._props[t];_ instanceof s.default&&_.__removeChild(this)}super.__detach()}update(){this._callback()}__makeNative(){if(!this.__isNative){for(var t in this.__isNative=!0,this._props){var _=this._props[t];_ instanceof s.default&&_.__makeNative()}this._animatedView&&this.__connectAnimatedView()}}setNativeView(t){this._animatedView!==t&&(this._animatedView=t,this.__isNative&&this.__connectAnimatedView())}__connectAnimatedView(){(0,l.default)(this.__isNative,'Expected node to be marked as "native"');var t=this._animatedView;(0,l.default)(null!=t,'Unable to locate attached view in the native tree'),o.default.API.connectAnimatedNodeToView(this.__getNativeTag(),t)}__disconnectAnimatedView(){(0,l.default)(this.__isNative,'Expected node to be marked as "native"');var t=this._animatedView;(0,l.default)(null!=t,'Unable to locate attached view in the native tree'),o.default.API.disconnectAnimatedNodeFromView(this.__getNativeTag(),t)}__restoreDefaultValues(){this.__isNative&&o.default.API.restoreDefaultValues(this.__getNativeTag())}__getNativeConfig(){var t={};for(var _ in this._props){var n=this._props[_];n instanceof s.default&&(n.__makeNative(),t[_]=n.__getNativeTag())}return{type:'props',props:t}}}e.default=h}),276,[1,5,277,286,278,10,289]); -__d((function(g,r,i,a,m,e,d){'use strict';var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var s=t(r(d[1])),n=t(r(d[2])),_=s.default.API,o=1;e.default=class{__attach(){}__detach(){this.__isNative&&null!=this.__nativeTag&&(s.default.API.dropAnimatedNode(this.__nativeTag),this.__nativeTag=void 0)}__getValue(){}__getAnimatedValue(){return this.__getValue()}__addChild(t){}__removeChild(t){}__getChildren(){return[]}constructor(){this._listeners={}}__makeNative(t){if(!this.__isNative)throw new Error('This node cannot be made a "native" animated node');this._platformConfig=t,this.hasListeners()&&this._startListeningToNativeValueUpdates()}addListener(t){var s=String(o++);return this._listeners[s]=t,this.__isNative&&this._startListeningToNativeValueUpdates(),s}removeListener(t){delete this._listeners[t],this.__isNative&&!this.hasListeners()&&this._stopListeningForNativeValueUpdates()}removeAllListeners(){this._listeners={},this.__isNative&&this._stopListeningForNativeValueUpdates()}hasListeners(){return!!Object.keys(this._listeners).length}_startListeningToNativeValueUpdates(){this.__nativeAnimatedValueListener&&!this.__shouldUpdateListenersForNewNativeTag||(this.__shouldUpdateListenersForNewNativeTag&&(this.__shouldUpdateListenersForNewNativeTag=!1,this._stopListeningForNativeValueUpdates()),_.startListeningToAnimatedNodeValue(this.__getNativeTag()),this.__nativeAnimatedValueListener=s.default.nativeEventEmitter.addListener('onAnimatedValueUpdate',(t=>{t.tag===this.__getNativeTag()&&this.__onAnimatedValueUpdateReceived(t.value)})))}__onAnimatedValueUpdateReceived(t){this.__callListeners(t)}__callListeners(t){for(var s in this._listeners)this._listeners[s]({value:t})}_stopListeningForNativeValueUpdates(){this.__nativeAnimatedValueListener&&(this.__nativeAnimatedValueListener.remove(),this.__nativeAnimatedValueListener=null,_.stopListeningToAnimatedNodeValue(this.__getNativeTag()))}__getNativeTag(){var t;s.default.assertNativeAnimatedModule(),(0,n.default)(this.__isNative,'Attempt to get native tag from node not marked as "native"');var _=null!==(t=this.__nativeTag)&&void 0!==t?t:s.default.generateNewNodeTag();if(null==this.__nativeTag){this.__nativeTag=_;var o=this.__getNativeConfig();this._platformConfig&&(o.platformConfig=this._platformConfig),s.default.API.createAnimatedNode(_,o),this.__shouldUpdateListenersForNewNativeTag=!0}return _}__getNativeConfig(){throw new Error('This JS animated node type cannot be used as native animated node')}toJSON(){return this.__getValue()}__getPlatformConfig(){return this._platformConfig}__setPlatformConfig(t){this._platformConfig=t}}}),277,[1,278,10]); -__d((function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.API=void 0,e.addWhitelistedInterpolationParam=I,e.addWhitelistedStyleProp=q,e.addWhitelistedTransformProp=V,e.assertNativeAnimatedModule=k,e.default=void 0,e.generateNewAnimationId=Q,e.generateNewNodeTag=W,e.isSupportedColorStyleProp=R,e.isSupportedInterpolationParam=E,e.isSupportedStyleProp=D,e.isSupportedTransformProp=C,e.shouldUseNativeDriver=M,e.transformDataType=X,e.validateInterpolation=L,e.validateStyles=x,e.validateTransform=F;var o,n=t(r(d[1])),u=t(r(d[2])),l=(t(r(d[3])),t(r(d[4]))),s=(t(r(d[5])),t(r(d[6]))),f=t(r(d[7])),p=(t(r(d[8])),u.default),v=1,c=1,N=new Set,b=!1,A=[],h=null,O=p,w=e.API={getValue:function(t,o){(0,f.default)(O,'Native animated module is not available'),w.queueOperation(O.getValue,t,o)},setWaitingForIdentifier:function(t){N.add(t),b=!0,s.default.animatedShouldDebounceQueueFlush()&&h&&clearTimeout(h)},unsetWaitingForIdentifier:function(t){N.delete(t),0===N.size&&(b=!1,w.disableQueue())},disableQueue:function(){((0,f.default)(O,'Native animated module is not available'),s.default.animatedShouldDebounceQueueFlush())?(clearImmediate(h),h=setImmediate(w.flushQueue)):w.flushQueue()},flushQueue:function(){},queueOperation:function(t){for(var o=arguments.length,n=new Array(o>1?o-1:0),u=1;ut(...n))):t(...n)},createAnimatedNode:function(t,o){(0,f.default)(O,'Native animated module is not available'),w.queueOperation(O.createAnimatedNode,t,o)},updateAnimatedNodeConfig:function(t,o){(0,f.default)(O,'Native animated module is not available')},startListeningToAnimatedNodeValue:function(t){(0,f.default)(O,'Native animated module is not available'),w.queueOperation(O.startListeningToAnimatedNodeValue,t)},stopListeningToAnimatedNodeValue:function(t){(0,f.default)(O,'Native animated module is not available'),w.queueOperation(O.stopListeningToAnimatedNodeValue,t)},connectAnimatedNodes:function(t,o){(0,f.default)(O,'Native animated module is not available'),w.queueOperation(O.connectAnimatedNodes,t,o)},disconnectAnimatedNodes:function(t,o){(0,f.default)(O,'Native animated module is not available'),w.queueOperation(O.disconnectAnimatedNodes,t,o)},startAnimatingNode:function(t,o,n,u){(0,f.default)(O,'Native animated module is not available'),w.queueOperation(O.startAnimatingNode,t,o,n,u)},stopAnimation:function(t){(0,f.default)(O,'Native animated module is not available'),w.queueOperation(O.stopAnimation,t)},setAnimatedNodeValue:function(t,o){(0,f.default)(O,'Native animated module is not available'),w.queueOperation(O.setAnimatedNodeValue,t,o)},setAnimatedNodeOffset:function(t,o){(0,f.default)(O,'Native animated module is not available'),w.queueOperation(O.setAnimatedNodeOffset,t,o)},flattenAnimatedNodeOffset:function(t){(0,f.default)(O,'Native animated module is not available'),w.queueOperation(O.flattenAnimatedNodeOffset,t)},extractAnimatedNodeOffset:function(t){(0,f.default)(O,'Native animated module is not available'),w.queueOperation(O.extractAnimatedNodeOffset,t)},connectAnimatedNodeToView:function(t,o){(0,f.default)(O,'Native animated module is not available'),w.queueOperation(O.connectAnimatedNodeToView,t,o)},disconnectAnimatedNodeFromView:function(t,o){(0,f.default)(O,'Native animated module is not available'),w.queueOperation(O.disconnectAnimatedNodeFromView,t,o)},restoreDefaultValues:function(t){(0,f.default)(O,'Native animated module is not available'),null!=O.restoreDefaultValues&&w.queueOperation(O.restoreDefaultValues,t)},dropAnimatedNode:function(t){(0,f.default)(O,'Native animated module is not available'),w.queueOperation(O.dropAnimatedNode,t)},addAnimatedEventToView:function(t,o,n){(0,f.default)(O,'Native animated module is not available'),w.queueOperation(O.addAnimatedEventToView,t,o,n)},removeAnimatedEventFromView(t,o,n){(0,f.default)(O,'Native animated module is not available'),w.queueOperation(O.removeAnimatedEventFromView,t,o,n)}},y={backgroundColor:!0,borderBottomColor:!0,borderColor:!0,borderEndColor:!0,borderLeftColor:!0,borderRightColor:!0,borderStartColor:!0,borderTopColor:!0,color:!0,tintColor:!0},T=(0,n.default)((0,n.default)({},y),{},{borderBottomEndRadius:!0,borderBottomLeftRadius:!0,borderBottomRightRadius:!0,borderBottomStartRadius:!0,borderRadius:!0,borderTopEndRadius:!0,borderTopLeftRadius:!0,borderTopRightRadius:!0,borderTopStartRadius:!0,elevation:!0,opacity:!0,transform:!0,zIndex:!0,shadowOpacity:!0,shadowRadius:!0,scaleX:!0,scaleY:!0,translateX:!0,translateY:!0}),P={translateX:!0,translateY:!0,scale:!0,scaleX:!0,scaleY:!0,rotate:!0,rotateX:!0,rotateY:!0,rotateZ:!0,perspective:!0},S={inputRange:!0,outputRange:!0,extrapolate:!0,extrapolateRight:!0,extrapolateLeft:!0};function q(t){T[t]=!0}function V(t){P[t]=!0}function I(t){S[t]=!0}function R(t){return y.hasOwnProperty(t)}function D(t){return T.hasOwnProperty(t)}function C(t){return P.hasOwnProperty(t)}function E(t){return S.hasOwnProperty(t)}function F(t){t.forEach((t=>{if(!C(t.property))throw new Error("Property '"+t.property+"' is not supported by native animated module")}))}function x(t){for(var o in t)if(!D(o))throw new Error("Style property '"+o+"' is not supported by native animated module")}function L(t){for(var o in t)if(!E(o))throw new Error("Interpolation property '"+o+"' is not supported by native animated module")}function W(){return v++}function Q(){return c++}function k(){(0,f.default)(p,'Native animated module is not available')}var B=!1;function M(t){return null==t.useNativeDriver&&console.warn("Animated: `useNativeDriver` was not specified. This is a required option and must be explicitly set to `true` or `false`"),!0!==t.useNativeDriver||p?t.useNativeDriver||!1:(B||(console.warn("Animated: `useNativeDriver` is not supported because the native animated module is missing. Falling back to JS-based animation. To resolve this, add `RCTAnimation` module to this app, or remove `useNativeDriver`. Make sure to run `bundle exec pod install` first. Read more about autolinking: https://github.com/react-native-community/cli/blob/master/docs/autolinking.md"),B=!0),!1)}function X(t){return'string'!=typeof t?t:/deg$/.test(t)?(parseFloat(t)||0)*Math.PI/180:t}e.default={API:w,isSupportedColorStyleProp:R,isSupportedStyleProp:D,isSupportedTransformProp:C,isSupportedInterpolationParam:E,addWhitelistedStyleProp:q,addWhitelistedTransformProp:V,addWhitelistedInterpolationParam:I,validateStyles:x,validateTransform:F,validateInterpolation:L,generateNewNodeTag:W,generateNewAnimationId:Q,assertNativeAnimatedModule:k,shouldUseNativeDriver:M,transformDataType:X,get nativeEventEmitter(){return o||(o=new l.default(null)),o}}}),278,[1,5,279,281,282,284,285,10,283]); -__d((function(g,_r,_i,_a,m,_e,d){Object.defineProperty(_e,"__esModule",{value:!0}),_e.default=void 0;var e=(function(e,r){if(!r&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=t(r);if(n&&n.has(e))return n.get(e);var u={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&{}.hasOwnProperty.call(e,a)){var f=o?Object.getOwnPropertyDescriptor(e,a):null;f&&(f.get||f.set)?Object.defineProperty(u,a,f):u[a]=e[a]}return u.default=e,n&&n.set(e,u),u})(_r(d[0]));function t(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap,n=new WeakMap;return(t=function(e){return e?n:r})(e)}_e.default=e.get('NativeAnimatedModule')}),279,[280]); -__d((function(g,r,i,a,m,e,d){'use strict';var n=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.get=u,e.getEnforcing=function(n){var u=null;return(0,t.default)(null!=u,"TurboModuleRegistry.getEnforcing(...): '"+n+"' could not be found. Verify that a module by this name is registered in the native binary."),u};var t=n(r(d[1]));function u(n){return null}}),280,[1,10]); -__d((function(g,_r,_i,_a,m,_e,d){Object.defineProperty(_e,"__esModule",{value:!0}),_e.default=void 0;var e=(function(e,r){if(!r&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=t(r);if(n&&n.has(e))return n.get(e);var u={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&{}.hasOwnProperty.call(e,a)){var f=o?Object.getOwnPropertyDescriptor(e,a):null;f&&(f.get||f.set)?Object.defineProperty(u,a,f):u[a]=e[a]}return u.default=e,n&&n.set(e,u),u})(_r(d[0]));function t(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap,n=new WeakMap;return(t=function(e){return e?n:r})(e)}_e.default=e.get('NativeAnimatedTurboModule')}),281,[280]); -__d((function(g,r,i,a,m,e,d){'use strict';var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;t(r(d[1]));var l=t(r(d[2])),n=t(r(d[3]));e.default=class{constructor(t){}addListener(t,n,u){var s;null==(s=this._nativeModule)||s.addListener(t);var v=l.default.addListener(t,n,u);return{remove:()=>{var t;null!=v&&(null==(t=this._nativeModule)||t.removeListeners(1),v.remove(),v=null)}}}removeListener(t,n){var u;null==(u=this._nativeModule)||u.removeListeners(1),l.default.removeListener(t,n)}emit(t){for(var n=arguments.length,u=new Array(n>1?n-1:0),s=1;s!0,shouldEmitW3CPointerEvents:()=>!1,shouldPressibilityUseW3CPointerEventsForHover:()=>!1,animatedShouldDebounceQueueFlush:()=>!1,animatedShouldUseSingleOp:()=>!1}}),285,[]); -__d((function(g,r,i,a,m,e,d){'use strict';var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var s=t(r(d[1])),l=t(r(d[2])),_=t(r(d[3])),n=t(r(d[4])),u=t(r(d[5])).default.flatten;function f(t){var _=u(t),n={};for(var y in _){var v=_[y];'transform'===y&&Array.isArray(v)?n[y]=new l.default(v):v instanceof s.default?n[y]=v:v&&!Array.isArray(v)&&'object'==typeof v&&(n[y]=f(v))}return n}class y extends _.default{constructor(t){super(),this._inputStyle=t,this._style=f(t)}_walkStyleAndGetValues(t){var l={};for(var _ in t){var n=t[_];n instanceof s.default?n.__isNative||(l[_]=n.__getValue()):n&&!Array.isArray(n)&&'object'==typeof n?l[_]=this._walkStyleAndGetValues(n):l[_]=n}return l}__getValue(){return[this._inputStyle,this._walkStyleAndGetValues(this._style)]}_walkStyleAndGetAnimatedValues(t){var l={};for(var _ in t){var n=t[_];n instanceof s.default?l[_]=n.__getAnimatedValue():n&&!Array.isArray(n)&&'object'==typeof n&&(l[_]=this._walkStyleAndGetAnimatedValues(n))}return l}__getAnimatedValue(){return this._walkStyleAndGetAnimatedValues(this._style)}__attach(){for(var t in this._style){var l=this._style[t];l instanceof s.default&&l.__addChild(this)}}__detach(){for(var t in this._style){var l=this._style[t];l instanceof s.default&&l.__removeChild(this)}super.__detach()}__makeNative(){for(var t in this._style){var l=this._style[t];l instanceof s.default&&l.__makeNative()}super.__makeNative()}__getNativeConfig(){var t={};for(var l in this._style)if(this._style[l]instanceof s.default){var _=this._style[l];_.__makeNative(),t[l]=_.__getNativeTag()}return n.default.validateStyles(t),{type:'style',style:t}}}e.default=y}),286,[1,277,287,288,278,27]); -__d((function(g,r,i,a,m,e,d){'use strict';var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var s=t(r(d[1])),n=t(r(d[2])),f=t(r(d[3]));class _ extends n.default{constructor(t){super(),this._transforms=t}__makeNative(){this._transforms.forEach((t=>{for(var n in t){var f=t[n];f instanceof s.default&&f.__makeNative()}})),super.__makeNative()}__getValue(){return this._transforms.map((t=>{var n={};for(var f in t){var _=t[f];_ instanceof s.default?n[f]=_.__getValue():n[f]=_}return n}))}__getAnimatedValue(){return this._transforms.map((t=>{var n={};for(var f in t){var _=t[f];_ instanceof s.default?n[f]=_.__getAnimatedValue():n[f]=_}return n}))}__attach(){this._transforms.forEach((t=>{for(var n in t){var f=t[n];f instanceof s.default&&f.__addChild(this)}}))}__detach(){this._transforms.forEach((t=>{for(var n in t){var f=t[n];f instanceof s.default&&f.__removeChild(this)}})),super.__detach()}__getNativeConfig(){var t=[];return this._transforms.forEach((n=>{for(var _ in n){var o=n[_];o instanceof s.default?t.push({type:'animated',property:_,nodeTag:o.__getNativeTag()}):t.push({type:'static',property:_,value:f.default.transformDataType(o)})}})),f.default.validateTransform(t),{type:'transform',transforms:t}}}e.default=_}),287,[1,277,288,278]); -__d((function(g,r,i,a,m,e,d){'use strict';var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var _=t(r(d[1])),s=t(r(d[2])),h=t(r(d[3]));class l extends s.default{constructor(){super(),this._children=[]}__makeNative(t){if(!this.__isNative){this.__isNative=!0;for(var s,l=(0,_.default)(this._children);!(s=l()).done;){var n=s.value;n.__makeNative(t),h.default.API.connectAnimatedNodes(this.__getNativeTag(),n.__getNativeTag())}}super.__makeNative(t)}__addChild(t){0===this._children.length&&this.__attach(),this._children.push(t),this.__isNative&&(t.__makeNative(this.__getPlatformConfig()),h.default.API.connectAnimatedNodes(this.__getNativeTag(),t.__getNativeTag()))}__removeChild(t){var _=this._children.indexOf(t);-1!==_?(this.__isNative&&t.__isNative&&h.default.API.disconnectAnimatedNodes(this.__getNativeTag(),t.__getNativeTag()),this._children.splice(_,1),0===this._children.length&&this.__detach()):console.warn("Trying to remove a child that doesn't exist")}__getChildren(){return this._children}__callListeners(t){if(super.__callListeners(t),!this.__isNative)for(var s,h=(0,_.default)(this._children);!(s=h()).done;){var l=s.value;l.__getValue&&l.__callListeners(l.__getValue())}}}e.default=l}),288,[1,246,277,278]); -__d((function(g,_r,_i,_a,m,_e,d){'use strict';var e=_r(d[0]);Object.defineProperty(_e,"__esModule",{value:!0}),_e.AnimatedEvent=void 0,_e.attachNativeEvent=r;var t=e(_r(d[1])),n=(function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var n=i(t);if(n&&n.has(e))return n.get(e);var a={__proto__:null},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&{}.hasOwnProperty.call(e,s)){var l=r?Object.getOwnPropertyDescriptor(e,s):null;l&&(l.get||l.set)?Object.defineProperty(a,s,l):a[s]=e[s]}return a.default=e,n&&n.set(e,a),a})(_r(d[2])),a=e(_r(d[3]));function i(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(i=function(e){return e?n:t})(e)}function r(e,i,r){var s=[],l=(e,n)=>{if(e instanceof t.default)e.__makeNative(),s.push({nativeEventPath:n,animatedValueTag:e.__getNativeTag()});else if('object'==typeof e)for(var a in e)l(e[a],n.concat(a))};return(0,a.default)(r[0]&&r[0].nativeEvent,'Native driven events only support animated values contained inside `nativeEvent`.'),l(r[0].nativeEvent,[]),null!=e&&s.forEach((t=>{n.default.API.addAnimatedEventToView(e,i,t)})),{detach(){null!=e&&s.forEach((t=>{n.default.API.removeAnimatedEventFromView(e,i,t.animatedValueTag)}))}}}_e.AnimatedEvent=class{constructor(e,t){this._listeners=[],this._argMapping=e,null==t&&(console.warn('Animated.event now requires a second argument for options'),t={useNativeDriver:!1}),t.listener&&this.__addListener(t.listener),this._callListeners=this._callListeners.bind(this),this._attachedEvent=null,this.__isNative=(0,n.shouldUseNativeDriver)(t)}__addListener(e){this._listeners.push(e)}__removeListener(e){this._listeners=this._listeners.filter((t=>t!==e))}__attach(e,t){(0,a.default)(this.__isNative,'Only native driven events need to be attached.'),this._attachedEvent=r(e,t,this._argMapping)}__detach(e,t){(0,a.default)(this.__isNative,'Only native driven events need to be detached.'),this._attachedEvent&&this._attachedEvent.detach()}__getHandler(){var e=this;if(this.__isNative)return this._callListeners;return function(){for(var n=arguments.length,a=new Array(n),i=0;i{if(e instanceof t.default)'number'==typeof n&&e.setValue(n);else if('object'==typeof e)for(var i in e)r(e[i],n[i],i)};e._argMapping.forEach(((e,t)=>{r(e,a[t],'arg'+t)})),e._callListeners(...a)}}_callListeners(){for(var e=arguments.length,t=new Array(e),n=0;ne(...t)))}}}),289,[1,290,278,10]); -__d((function(g,r,i,a,m,e,d){'use strict';var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var s=t(r(d[1])),n=t(r(d[2])),_=t(r(d[3])),h=t(r(d[4])).default.API;class u extends n.default{constructor(t,s){if(super(),'number'!=typeof t)throw new Error('AnimatedValue: Attempting to set value to undefined');this._startingValue=this._value=t,this._offset=0,this._animation=null,s&&s.useNativeDriver&&this.__makeNative()}__detach(){this.__isNative&&h.getValue(this.__getNativeTag(),(t=>{this._value=t-this._offset})),this.stopAnimation(),super.__detach()}__getValue(){return this._value+this._offset}setValue(t){var s,n;this._animation&&(this._animation.stop(),this._animation=null),this._updateValue(t,!this.__isNative),this.__isNative&&(s=this.__getNativeTag().toString(),n=()=>h.setAnimatedNodeValue(this.__getNativeTag(),t),h.setWaitingForIdentifier(s),n(),h.unsetWaitingForIdentifier(s))}setOffset(t){this._offset=t,this.__isNative&&h.setAnimatedNodeOffset(this.__getNativeTag(),t)}flattenOffset(){this._value+=this._offset,this._offset=0,this.__isNative&&h.flattenAnimatedNodeOffset(this.__getNativeTag())}extractOffset(){this._offset+=this._value,this._value=0,this.__isNative&&h.extractAnimatedNodeOffset(this.__getNativeTag())}stopAnimation(t){this.stopTracking(),this._animation&&this._animation.stop(),this._animation=null,t&&(this.__isNative?h.getValue(this.__getNativeTag(),t):t(this.__getValue()))}resetAnimation(t){this.stopAnimation(t),this._value=this._startingValue,this.__isNative&&h.setAnimatedNodeValue(this.__getNativeTag(),this._startingValue)}__onAnimatedValueUpdateReceived(t){this._updateValue(t,!1)}interpolate(t){return new s.default(this,t)}animate(t,s){var n=null;t.__isInteraction&&(n=_.default.createInteractionHandle());var h=this._animation;this._animation&&this._animation.stop(),this._animation=t,t.start(this._value,(t=>{this._updateValue(t,!0)}),(t=>{this._animation=null,null!==n&&_.default.clearInteractionHandle(n),s&&s(t)}),h,this)}stopTracking(){this._tracking&&this._tracking.__detach(),this._tracking=null}track(t){this.stopTracking(),this._tracking=t,this._tracking&&this._tracking.update()}_updateValue(t,s){if(void 0===t)throw new Error('AnimatedValue: Attempting to set value to undefined');var n,_;this._value=t,s&&(n=this,_=new Set,(function t(s){'function'==typeof s.update?_.add(s):s.__getChildren().forEach(t)})(n),_.forEach((t=>t.update()))),super.__callListeners(this.__getValue())}__getNativeConfig(){return{type:'value',value:this._value,offset:this._offset}}}e.default=u}),290,[1,291,288,258,278]); -__d((function(_g,_r,_i,_a,m,e,d){'use strict';var t=_r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var a=t(_r(d[1])),r=t(_r(d[2])),n=t(_r(d[3])),i=t(_r(d[4])),o=t(_r(d[5])),u=t=>t;function p(t){if(t.outputRange&&'string'==typeof t.outputRange[0])return h(t);var a=t.outputRange,r=t.inputRange,n=t.easing||u,o='extend';void 0!==t.extrapolateLeft?o=t.extrapolateLeft:void 0!==t.extrapolate&&(o=t.extrapolate);var p='extend';return void 0!==t.extrapolateRight?p=t.extrapolateRight:void 0!==t.extrapolate&&(p=t.extrapolate),t=>{(0,i.default)('number'==typeof t,'Cannot interpolation an input which is not a number');var u=g(t,r);return l(t,r[u],r[u+1],a[u],a[u+1],n,o,p)}}function l(t,a,r,n,i,o,u,p){var l=t;if(lr){if('identity'===p)return l;'clamp'===p&&(l=r)}return n===i?n:a===r?t<=a?n:i:(a===-1/0?l=-l:r===1/0?l-=a:l=(l-a)/(r-a),l=o(l),n===-1/0?l=-l:i===1/0?l+=n:l=l*(i-n)+n,l)}function f(t){var a=(0,o.default)(t);return null===a||'number'!=typeof a?t:"rgba("+((4278190080&(a=a||0))>>>24)+", "+((16711680&a)>>>16)+", "+((65280&a)>>>8)+", "+(255&a)/255+")"}var _=/[+-]?(?:\d+\.?\d*|\.\d+)(?:[eE][+-]?\d+)?/g;function h(t){var r=t.outputRange;(0,i.default)(r.length>=2,'Bad output range'),s(r=r.map(f));var n=r[0].match(_).map((()=>[]));r.forEach((t=>{t.match(_).forEach(((t,a)=>{n[a].push(+t)}))}));var o,u=r[0].match(_).map(((r,i)=>p((0,a.default)((0,a.default)({},t),{},{outputRange:n[i]})))),l='string'==typeof(o=r[0])&&o.startsWith('rgb');return t=>{var a=0;return r[0].replace(_,(()=>{var r=+u[a++](t);return l&&(r=a<4?Math.round(r):Math.round(1e3*r)/1e3),String(r)}))}}function s(t){for(var a=t[0].replace(_,''),r=1;r=t);++r);return r-1}class c extends r.default{constructor(t,a){super(),this._parent=t,this._config=a,this._interpolation=p(a)}__makeNative(t){this._parent.__makeNative(t),super.__makeNative(t)}__getValue(){var t=this._parent.__getValue();return(0,i.default)('number'==typeof t,'Cannot interpolate an input which is not a number.'),this._interpolation(t)}interpolate(t){return new c(this,t)}__attach(){this._parent.__addChild(this)}__detach(){this._parent.__removeChild(this),super.__detach()}__transformDataType(t){return t.map(n.default.transformDataType)}__getNativeConfig(){return{inputRange:this._config.inputRange,outputRange:this.__transformDataType(this._config.outputRange),extrapolateLeft:this._config.extrapolateLeft||this._config.extrapolate||'extend',extrapolateRight:this._config.extrapolateRight||this._config.extrapolate||'extend',type:'interpolation'}}}c.__createInterpolation=p;e.default=c}),291,[1,5,288,278,10,36]); -__d((function(g,r,i,a,m,e,d){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(n){var t=(0,u.useRef)(void 0);return(0,u.useCallback)((u=>{t.current&&(t.current(),t.current=void 0),null!=u&&(t.current=n(u))}),[n])};var u=r(d[0])}),292,[14]); -__d((function(g,r,i,a,m,e,d){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(){for(var t=arguments.length,u=new Array(t),l=0;l{for(var t=0,l=u;tr.createElement(n.default,(0,t.default)({scrollEventThrottle:1e-4},e,{ref:f}))));_e.default=(0,f.default)(u)}),295,[1,19,14,250,274]); -__d((function(g,_r,_i,_a,m,_e,d){var e=_r(d[0]);Object.defineProperty(_e,"__esModule",{value:!0}),_e.default=void 0;var t=e(_r(d[1])),r=(function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=a(t);if(r&&r.has(e))return r.get(e);var n={__proto__:null},f=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&{}.hasOwnProperty.call(e,u)){var o=f?Object.getOwnPropertyDescriptor(e,u):null;o&&(o.get||o.set)?Object.defineProperty(n,u,o):n[u]=e[u]}return n.default=e,r&&r.set(e,n),n})(_r(d[2])),n=e(_r(d[3])),f=e(_r(d[4]));function a(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(a=function(e){return e?r:t})(e)}var u=r.forwardRef(((e,f)=>r.createElement(n.default,(0,t.default)({scrollEventThrottle:1e-4},e,{ref:f}))));_e.default=(0,f.default)(u)}),296,[1,19,14,297,274]); -__d((function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var u=t(r(d[1]));e.default=u.default}),297,[1,298]); -__d((function(g,_r,_i,_a,m,_e,d){'use strict';var e=_r(d[0]);Object.defineProperty(_e,"__esModule",{value:!0}),_e.default=void 0;var t=e(_r(d[1])),r=e(_r(d[2])),a=(e(_r(d[3])),(function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=n(t);if(r&&r.has(e))return r.get(e);var a={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&{}.hasOwnProperty.call(e,s)){var o=i?Object.getOwnPropertyDescriptor(e,s):null;o&&(o.get||o.set)?Object.defineProperty(a,s,o):a[s]=e[s]}return a.default=e,r&&r.set(e,a),a})(_r(d[4]))),i=e(_r(d[5]));function n(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(n=function(e){return e?r:t})(e)}var s=["stickySectionHeadersEnabled"];class o extends a.PureComponent{constructor(){super(...arguments),this._captureRef=e=>{this._wrapperListRef=e}}scrollToLocation(e){null!=this._wrapperListRef&&this._wrapperListRef.scrollToLocation(e)}recordInteraction(){var e=this._wrapperListRef&&this._wrapperListRef.getListRef();e&&e.recordInteraction()}flashScrollIndicators(){var e=this._wrapperListRef&&this._wrapperListRef.getListRef();e&&e.flashScrollIndicators()}getScrollResponder(){var e=this._wrapperListRef&&this._wrapperListRef.getListRef();if(e)return e.getScrollResponder()}getScrollableNode(){var e=this._wrapperListRef&&this._wrapperListRef.getListRef();if(e)return e.getScrollableNode()}render(){var e=this.props,n=e.stickySectionHeadersEnabled,o=(0,r.default)(e,s),l=null!=n&&n;return a.createElement(i.default,(0,t.default)({},o,{stickySectionHeadersEnabled:l,ref:this._captureRef,getItemCount:e=>e.length,getItem:(e,t)=>e[t]}))}}_e.default=o}),298,[1,19,28,77,14,299]); -__d((function(g,_r,_i,_a,m,_e,d){var e=_r(d[0]);Object.defineProperty(_e,"__esModule",{value:!0}),_e.default=void 0;var t=e(_r(d[1])),r=e(_r(d[2])),i=e(_r(d[3])),n=e(_r(d[4])),a=e(_r(d[5])),o=e(_r(d[6])),l=e(_r(d[7])),s=(function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=p(t);if(r&&r.has(e))return r.get(e);var i={__proto__:null},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&{}.hasOwnProperty.call(e,a)){var o=n?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(i,a,o):i[a]=e[a]}return i.default=e,r&&r.set(e,i),i})(_r(d[8]));function p(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(p=function(e){return e?r:t})(e)}var u=["ItemSeparatorComponent","SectionSeparatorComponent","renderItem","renderSectionFooter","renderSectionHeader","sections","stickySectionHeadersEnabled"];class c extends s.PureComponent{constructor(){super(...arguments),this._keyExtractor=(e,t)=>{var r=this._subExtractor(t);return r&&r.key||String(t)},this._convertViewable=e=>{var t;(0,l.default)(null!=e.index,'Received a broken ViewToken');var r=this._subExtractor(e.index);if(!r)return null;var i=r.section.keyExtractor,a=this.props.keyExtractor||_r(d[9]).keyExtractor,o=null!=i?i(e.item,r.index):a(e.item,null!==(t=r.index)&&void 0!==t?t:0);return(0,n.default)((0,n.default)({},e),{},{index:r.index,key:o,section:r.section})},this._onViewableItemsChanged=e=>{var t=e.viewableItems,r=e.changed,i=this.props.onViewableItemsChanged;null!=i&&i({viewableItems:t.map(this._convertViewable,this).filter(Boolean),changed:r.map(this._convertViewable,this).filter(Boolean)})},this._renderItem=e=>t=>{var r=t.item,i=t.index,n=this._subExtractor(i);if(!n)return null;var a=n.index;if(null==a){var o=n.section;if(!0===n.header){var p=this.props.renderSectionHeader;return p?p({section:o}):null}var u=this.props.renderSectionFooter;return u?u({section:o}):null}var c=n.section.renderItem||this.props.renderItem,f=this._getSeparatorComponent(i,n,e);return(0,l.default)(c,'no renderItem!'),s.createElement(h,{SeparatorComponent:f,LeadingSeparatorComponent:0===a?this.props.SectionSeparatorComponent:void 0,cellKey:n.key,index:a,item:r,leadingItem:n.leadingItem,leadingSection:n.leadingSection,prevCellKey:(this._subExtractor(i-1)||{}).key,setSelfHighlightCallback:this._setUpdateHighlightFor,setSelfUpdatePropsCallback:this._setUpdatePropsFor,updateHighlightFor:this._updateHighlightFor,updatePropsFor:this._updatePropsFor,renderItem:c,section:n.section,trailingItem:n.trailingItem,trailingSection:n.trailingSection,inverted:!!this.props.inverted})},this._updatePropsFor=(e,t)=>{var r=this._updatePropsMap[e];null!=r&&r(t)},this._updateHighlightFor=(e,t)=>{var r=this._updateHighlightMap[e];null!=r&&r(t)},this._setUpdateHighlightFor=(e,t)=>{null!=t?this._updateHighlightMap[e]=t:delete this._updateHighlightFor[e]},this._setUpdatePropsFor=(e,t)=>{null!=t?this._updatePropsMap[e]=t:delete this._updatePropsMap[e]},this._updateHighlightMap={},this._updatePropsMap={},this._captureRef=e=>{this._listRef=e}}scrollToLocation(e){for(var t=e.itemIndex,r=0;r0&&this.props.stickySectionHeadersEnabled)i+=this._listRef.__getFrameMetricsApprox(t-e.itemIndex,this._listRef.props).length;var a=(0,n.default)((0,n.default)({},e),{},{viewOffset:i,index:t});this._listRef.scrollToIndex(a)}}getListRef(){return this._listRef}render(){for(var e,n=this.props,a=(n.ItemSeparatorComponent,n.SectionSeparatorComponent,n.renderItem,n.renderSectionFooter,n.renderSectionHeader,n.sections,n.stickySectionHeadersEnabled,(0,i.default)(n,u)),l=this.props.ListHeaderComponent?1:0,p=this.props.stickySectionHeadersEnabled?[]:void 0,c=0,h=(0,r.default)(this.props.sections);!(e=h()).done;){var f=e.value;null!=p&&p.push(c+l),c+=2,c+=this.props.getItemCount(f.data)}var _=this._renderItem(c);return s.createElement(o.default,(0,t.default)({},a,{keyExtractor:this._keyExtractor,stickyHeaderIndices:p,renderItem:_,data:this.props.sections,getItem:(e,t)=>this._getItem(this.props,e,t),getItemCount:()=>c,onViewableItemsChanged:this.props.onViewableItemsChanged?this._onViewableItemsChanged:void 0,ref:this._captureRef}))}_getItem(e,t,r){if(!t)return null;for(var i=r-1,n=0;n=n(p)+1))return-1===t?{section:s,key:u+':header',index:null,header:!0,trailingSection:o[l+1]}:t===n(p)?{section:s,key:u+':footer',index:null,header:!1,trailingSection:o[l+1]}:{section:s,key:u+':'+(s.keyExtractor||a||_r(d[9]).keyExtractor)(i(p,t),t),index:t,leadingItem:i(p,t-1),leadingSection:o[l-1],trailingItem:i(p,t+1),trailingSection:o[l+1]};t-=n(p)+1}}_getSeparatorComponent(e,t,r){if(!(t=t||this._subExtractor(e)))return null;var i=t.section.ItemSeparatorComponent||this.props.ItemSeparatorComponent,n=this.props.SectionSeparatorComponent,a=e===r-1,o=t.index===this.props.getItemCount(t.section.data)-1;return n&&o?n:!i||o||a?null:i}}function h(e){var r=e.LeadingSeparatorComponent,i=e.SeparatorComponent,o=e.cellKey,l=e.prevCellKey,p=e.setSelfHighlightCallback,u=e.updateHighlightFor,c=e.setSelfUpdatePropsCallback,h=e.updatePropsFor,f=e.item,_=e.index,v=e.section,S=e.inverted,I=s.useState(!1),x=I[0],y=I[1],C=s.useState(!1),b=C[0],k=C[1],E=s.useState({leadingItem:e.leadingItem,leadingSection:e.leadingSection,section:e.section,trailingItem:e.item,trailingSection:e.trailingSection}),H=E[0],P=E[1],w=s.useState({leadingItem:e.item,leadingSection:e.leadingSection,section:e.section,trailingItem:e.trailingItem,trailingSection:e.trailingSection}),F=w[0],M=w[1];s.useEffect((()=>(p(o,k),c(o,M),()=>{c(o,null),p(o,null)})),[o,p,M,c]);var O={highlight:()=>{y(!0),k(!0),null!=l&&u(l,!0)},unhighlight:()=>{y(!1),k(!1),null!=l&&u(l,!1)},updateProps:(e,t)=>{'leading'===e?null!=r?P((0,n.default)((0,n.default)({},H),t)):null!=l&&h(l,(0,n.default)((0,n.default)({},H),t)):'trailing'===e&&null!=i&&M((0,n.default)((0,n.default)({},F),t))}},R=e.renderItem({item:f,index:_,section:v,separators:O}),V=null!=r&&s.createElement(r,(0,t.default)({highlighted:x},H)),j=null!=i&&s.createElement(i,(0,t.default)({highlighted:b},F));return V||j?s.createElement(a.default,null,!1===S?V:j,R,!1===S?j:V):R}_e.default=c}),299,[1,19,246,28,5,122,245,10,14,272]); -__d((function(g,_r,_i,_a,m,_e,d){var e=_r(d[0]);Object.defineProperty(_e,"__esModule",{value:!0}),_e.default=void 0;!(function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=n(t);if(r&&r.has(e))return r.get(e);var u={__proto__:null},f=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&{}.hasOwnProperty.call(e,a)){var o=f?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(u,a,o):u[a]=e[a]}u.default=e,r&&r.set(e,u)})(_r(d[1]));var t=e(_r(d[2])),r=e(_r(d[3]));function n(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(n=function(e){return e?r:t})(e)}_e.default=(0,r.default)(t.default)}),300,[1,14,92,274]); -__d((function(g,_r,_i,_a,m,_e,d){var e=_r(d[0]);Object.defineProperty(_e,"__esModule",{value:!0}),_e.default=void 0;!(function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=n(t);if(r&&r.has(e))return r.get(e);var u={__proto__:null},f=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&{}.hasOwnProperty.call(e,a)){var o=f?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(u,a,o):u[a]=e[a]}u.default=e,r&&r.set(e,u)})(_r(d[1]));var t=e(_r(d[2])),r=e(_r(d[3]));function n(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(n=function(e){return e?r:t})(e)}_e.default=(0,r.default)(t.default)}),301,[1,14,122,274]); -__d((function(g,r,i,a,m,e,d){'use strict';var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=t(r(d[1])),u=t(r(d[2])),l=t(r(d[3])),f=t(r(d[4])),o=t(r(d[5])),s=t(r(d[6])),v=t(r(d[7])),c=t(r(d[8])),p=!1;function E(t){return n=>{var u=null==n?n:function(){if(p)console.warn('Ignoring recursive animation callback when running mock animations');else{p=!0;try{n(...arguments)}finally{p=!1}}};t(u)}}var h={start:()=>{},stop:()=>{},reset:()=>{},_startNativeLoop:()=>{},_isUsingNativeDriver:()=>!1},y=t=>(0,n.default)((0,n.default)({},h),{},{start:E((n=>{t.forEach((t=>t.start())),null==n||n({finished:!0})}))});e.default={Value:o.default,ValueXY:s.default,Color:c.default,Interpolation:l.default,Node:f.default,decay:function(t,n){return h},timing:function(t,u){var l=t;return(0,n.default)((0,n.default)({},h),{},{start:E((t=>{l.setValue(u.toValue),null==t||t({finished:!0})}))})},spring:function(t,u){var l=t;return(0,n.default)((0,n.default)({},h),{},{start:E((t=>{l.setValue(u.toValue),null==t||t({finished:!0})}))})},add:u.default.add,subtract:u.default.subtract,divide:u.default.divide,multiply:u.default.multiply,modulo:u.default.modulo,diffClamp:u.default.diffClamp,delay:function(t){return h},sequence:function(t){return y(t)},parallel:function(t,n){return y(t)},stagger:function(t,n){return y(n)},loop:function(t,n){(void 0===n?{}:n).iterations;return h},event:u.default.event,createAnimatedComponent:v.default,attachNativeEvent:r(d[9]).attachNativeEvent,forkEvent:u.default.forkEvent,unforkEvent:u.default.unforkEvent,Event:r(d[9]).AnimatedEvent}}),302,[1,5,303,291,277,290,311,274,316,289]); -__d((function(_g,_r,_i,_a,m,e,d){'use strict';var t=_r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=t(_r(d[1])),i=t(_r(d[2])),r=t(_r(d[3])),a=t(_r(d[4])),o=t(_r(d[5])),u=t(_r(d[6])),f=t(_r(d[7])),s=t(_r(d[8])),c=(t(_r(d[9])),t(_r(d[10]))),v=t(_r(d[11])),l=t(_r(d[12])),p=t(_r(d[13])),g=t(_r(d[14])),h=t(_r(d[15])),_=t(_r(d[16])),N=t(_r(d[17])),w=t(_r(d[18])),E=function(t,n){return t&&n.onComplete?function(){n.onComplete&&n.onComplete(...arguments),t&&t(...arguments)}:t||n.onComplete},A=function(t,i,r){if(t instanceof p.default){var a=(0,n.default)({},i),o=(0,n.default)({},i);for(var u in i){var f=i[u],s=f.x,c=f.y;void 0!==s&&void 0!==c&&(a[u]=s,o[u]=c)}var v=r(t.x,a),l=r(t.y,o);return y([v,l],{stopTogether:!1})}if(t instanceof w.default){var g=(0,n.default)({},i),h=(0,n.default)({},i),_=(0,n.default)({},i),N=(0,n.default)({},i);for(var E in i){var A=i[E],D=A.r,L=A.g,U=A.b,k=A.a;void 0!==D&&void 0!==L&&void 0!==U&&void 0!==k&&(g[E]=D,h[E]=L,_[E]=U,N[E]=k)}var C=r(t.r,g),V=r(t.g,h),T=r(t.b,_),b=r(t.a,N);return y([C,V,T,b],{stopTogether:!1})}return null},D=function t(i,r){var a=function(t,n,i){i=E(i,n);var r=t,a=n;r.stopTracking(),n.toValue instanceof s.default?r.track(new v.default(r,n.toValue,_.default,a,i)):r.animate(new _.default(a),i)};return A(i,r,t)||{start:function(t){a(i,r,t)},stop:function(){i.stopAnimation()},reset:function(){i.resetAnimation()},_startNativeLoop:function(t){var o=(0,n.default)((0,n.default)({},r),{},{iterations:t});a(i,o)},_isUsingNativeDriver:function(){return r.useNativeDriver||!1}}},L=function(t){var n=0;return{start:function(i){0===t.length?i&&i({finished:!0}):t[n].start((function r(a){a.finished&&++n!==t.length?t[n].start(r):i&&i(a)}))},stop:function(){n{i<=n&&t.reset()})),n=0},_startNativeLoop:function(){throw new Error('Loops run using the native driver cannot contain Animated.sequence animations')},_isUsingNativeDriver:function(){return!1}}},y=function(t,n){var i=0,r={},a=!(n&&!1===n.stopTogether),o={start:function(n){i!==t.length?t.forEach(((u,f)=>{var s=function(u){if(r[f]=!0,++i===t.length)return i=0,void(n&&n(u));!u.finished&&a&&o.stop()};u?u.start(s):s({finished:!0})})):n&&n({finished:!0})},stop:function(){t.forEach(((t,n)=>{!r[n]&&t.stop(),r[n]=!0}))},reset:function(){t.forEach(((t,n)=>{t.reset(),r[n]=!1,i=0}))},_startNativeLoop:function(){throw new Error('Loops run using the native driver cannot contain Animated.parallel animations')},_isUsingNativeDriver:function(){return!1}};return o},U=function(t){return D(new l.default(0),{toValue:0,delay:t,duration:0,useNativeDriver:!1})};e.default={Value:l.default,ValueXY:p.default,Color:w.default,Interpolation:o.default,Node:s.default,decay:function t(i,r){var a=function(t,n,i){i=E(i,n);var r=t,a=n;r.stopTracking(),r.animate(new g.default(a),i)};return A(i,r,t)||{start:function(t){a(i,r,t)},stop:function(){i.stopAnimation()},reset:function(){i.resetAnimation()},_startNativeLoop:function(t){var o=(0,n.default)((0,n.default)({},r),{},{iterations:t});a(i,o)},_isUsingNativeDriver:function(){return r.useNativeDriver||!1}}},timing:D,spring:function t(i,r){var a=function(t,n,i){i=E(i,n);var r=t,a=n;r.stopTracking(),n.toValue instanceof s.default?r.track(new v.default(r,n.toValue,h.default,a,i)):r.animate(new h.default(a),i)};return A(i,r,t)||{start:function(t){a(i,r,t)},stop:function(){i.stopAnimation()},reset:function(){i.resetAnimation()},_startNativeLoop:function(t){var o=(0,n.default)((0,n.default)({},r),{},{iterations:t});a(i,o)},_isUsingNativeDriver:function(){return r.useNativeDriver||!1}}},add:function(t,n){return new i.default(t,n)},subtract:function(t,n){return new c.default(t,n)},divide:function(t,n){return new a.default(t,n)},multiply:function(t,n){return new f.default(t,n)},modulo:function(t,n){return new u.default(t,n)},diffClamp:function(t,n,i){return new r.default(t,n,i)},delay:U,sequence:L,parallel:y,stagger:function(t,n){return y(n.map(((n,i)=>L([U(t*i),n]))))},loop:function(t,n){var i=void 0===n?{}:n,r=i.iterations,a=void 0===r?-1:r,o=i.resetBeforeIteration,u=void 0===o||o,f=!1,s=0;return{start:function(n){t&&0!==a?t._isUsingNativeDriver()?t._startNativeLoop(a):(function i(r){void 0===r&&(r={finished:!0}),f||s===a||!1===r.finished?n&&n(r):(s++,u&&t.reset(),t.start(i))})():n&&n({finished:!0})},stop:function(){f=!0,t.stop()},reset:function(){s=0,f=!1,t.reset()},_startNativeLoop:function(){throw new Error('Loops run using the native driver cannot contain Animated.loop animations')},_isUsingNativeDriver:function(){return t._isUsingNativeDriver()}}},event:function(t,n){var i=new(_r(d[19]).AnimatedEvent)(t,n);return i.__isNative?i:i.__getHandler()},createAnimatedComponent:N.default,attachNativeEvent:_r(d[19]).attachNativeEvent,forkEvent:function(t,n){return t?t instanceof _r(d[19]).AnimatedEvent?(t.__addListener(n),t):function(){'function'==typeof t&&t(...arguments),n(...arguments)}:n},unforkEvent:function(t,n){t&&t instanceof _r(d[19]).AnimatedEvent&&t.__removeListener(n)},Event:_r(d[19]).AnimatedEvent}}),303,[1,5,304,305,306,291,307,308,277,276,309,310,290,311,312,314,317,274,316,289]); -__d((function(g,r,i,_a,m,e,d){'use strict';var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var _=t(r(d[1])),a=t(r(d[2])),s=t(r(d[3]));class h extends s.default{constructor(t,_){super(),this._a='number'==typeof t?new a.default(t):t,this._b='number'==typeof _?new a.default(_):_}__makeNative(t){this._a.__makeNative(t),this._b.__makeNative(t),super.__makeNative(t)}__getValue(){return this._a.__getValue()+this._b.__getValue()}interpolate(t){return new _.default(this,t)}__attach(){this._a.__addChild(this),this._b.__addChild(this)}__detach(){this._a.__removeChild(this),this._b.__removeChild(this),super.__detach()}__getNativeConfig(){return{type:'addition',input:[this._a.__getNativeTag(),this._b.__getNativeTag()]}}}e.default=h}),304,[1,291,290,288]); -__d((function(g,r,i,_a,m,e,d){'use strict';var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var a=t(r(d[1])),_=t(r(d[2]));class s extends _.default{constructor(t,a,_){super(),this._a=t,this._min=a,this._max=_,this._value=this._lastValue=this._a.__getValue()}__makeNative(t){this._a.__makeNative(t),super.__makeNative(t)}interpolate(t){return new a.default(this,t)}__getValue(){var t=this._a.__getValue(),a=t-this._lastValue;return this._lastValue=t,this._value=Math.min(Math.max(this._value+a,this._min),this._max),this._value}__attach(){this._a.__addChild(this)}__detach(){this._a.__removeChild(this),super.__detach()}__getNativeConfig(){return{type:'diffclamp',input:this._a.__getNativeTag(),min:this._min,max:this._max}}}e.default=s}),305,[1,291,288]); -__d((function(g,r,i,_a,m,e,d){'use strict';var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var _=t(r(d[1])),a=t(r(d[2])),s=t(r(d[3])),o=t(r(d[4]));class n extends o.default{constructor(t,_){super(),this._warnedAboutDivideByZero=!1,(0===_||_ instanceof a.default&&0===_.__getValue())&&console.error('Detected potential division by zero in AnimatedDivision'),this._a='number'==typeof t?new s.default(t):t,this._b='number'==typeof _?new s.default(_):_}__makeNative(t){this._a.__makeNative(t),this._b.__makeNative(t),super.__makeNative(t)}__getValue(){var t=this._a.__getValue(),_=this._b.__getValue();return 0===_?(this._warnedAboutDivideByZero||(console.error('Detected division by zero in AnimatedDivision'),this._warnedAboutDivideByZero=!0),0):(this._warnedAboutDivideByZero=!1,t/_)}interpolate(t){return new _.default(this,t)}__attach(){this._a.__addChild(this),this._b.__addChild(this)}__detach(){this._a.__removeChild(this),this._b.__removeChild(this),super.__detach()}__getNativeConfig(){return{type:'division',input:[this._a.__getNativeTag(),this._b.__getNativeTag()]}}}e.default=n}),306,[1,291,277,290,288]); -__d((function(g,r,i,_a,m,e,d){'use strict';var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var _=t(r(d[1])),u=t(r(d[2]));class a extends u.default{constructor(t,_){super(),this._a=t,this._modulus=_}__makeNative(t){this._a.__makeNative(t),super.__makeNative(t)}__getValue(){return(this._a.__getValue()%this._modulus+this._modulus)%this._modulus}interpolate(t){return new _.default(this,t)}__attach(){this._a.__addChild(this)}__detach(){this._a.__removeChild(this),super.__detach()}__getNativeConfig(){return{type:'modulus',input:this._a.__getNativeTag(),modulus:this._modulus}}}e.default=a}),307,[1,291,288]); -__d((function(g,r,i,_a,m,e,d){'use strict';var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var _=t(r(d[1])),a=t(r(d[2])),s=t(r(d[3]));class h extends s.default{constructor(t,_){super(),this._a='number'==typeof t?new a.default(t):t,this._b='number'==typeof _?new a.default(_):_}__makeNative(t){this._a.__makeNative(t),this._b.__makeNative(t),super.__makeNative(t)}__getValue(){return this._a.__getValue()*this._b.__getValue()}interpolate(t){return new _.default(this,t)}__attach(){this._a.__addChild(this),this._b.__addChild(this)}__detach(){this._a.__removeChild(this),this._b.__removeChild(this),super.__detach()}__getNativeConfig(){return{type:'multiplication',input:[this._a.__getNativeTag(),this._b.__getNativeTag()]}}}e.default=h}),308,[1,291,290,288]); -__d((function(g,r,i,_a,m,e,d){'use strict';var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var _=t(r(d[1])),a=t(r(d[2])),s=t(r(d[3]));class h extends s.default{constructor(t,_){super(),this._a='number'==typeof t?new a.default(t):t,this._b='number'==typeof _?new a.default(_):_}__makeNative(t){this._a.__makeNative(t),this._b.__makeNative(t),super.__makeNative(t)}__getValue(){return this._a.__getValue()-this._b.__getValue()}interpolate(t){return new _.default(this,t)}__attach(){this._a.__addChild(this),this._b.__addChild(this)}__detach(){this._a.__removeChild(this),this._b.__removeChild(this),super.__detach()}__getNativeConfig(){return{type:'subtraction',input:[this._a.__getNativeTag(),this._b.__getNativeTag()]}}}e.default=h}),309,[1,291,290,288]); -__d((function(g,r,i,a,m,e,d){'use strict';var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var _=t(r(d[1])),n=(t(r(d[2])),t(r(d[3])));class s extends n.default{constructor(t,_,n,s,h){super(),this._value=t,this._parent=_,this._animationClass=n,this._animationConfig=s,this._useNativeDriver=(0,r(d[4]).shouldUseNativeDriver)(s),this._callback=h,this.__attach()}__makeNative(){this.__isNative=!0,this._parent.__makeNative(),super.__makeNative(),this._value.__makeNative()}__getValue(){return this._parent.__getValue()}__attach(){this._parent.__addChild(this),this._useNativeDriver&&this.__makeNative()}__detach(){this._parent.__removeChild(this),super.__detach()}update(){this._value.animate(new this._animationClass((0,_.default)((0,_.default)({},this._animationConfig),{},{toValue:this._animationConfig.toValue.__getValue()})),this._callback)}__getNativeConfig(){var t=new this._animationClass((0,_.default)((0,_.default)({},this._animationConfig),{},{toValue:void 0})).__getNativeAnimationConfig();return{type:'tracking',animationId:(0,r(d[4]).generateNewAnimationId)(),animationConfig:t,toValue:this._parent.__getNativeTag(),value:this._value.__getNativeTag()}}}e.default=s}),310,[1,5,290,277,278]); -__d((function(g,r,i,a,m,e,d){'use strict';var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var s=t(r(d[1])),n=t(r(d[2])),l=t(r(d[3])),f=1;class h extends n.default{constructor(t){super();var n=t||{x:0,y:0};'number'==typeof n.x&&'number'==typeof n.y?(this.x=new s.default(n.x),this.y=new s.default(n.y)):((0,l.default)(n.x instanceof s.default&&n.y instanceof s.default,"AnimatedValueXY must be initialized with an object of numbers or AnimatedValues."),this.x=n.x,this.y=n.y),this._listeners={}}setValue(t){this.x.setValue(t.x),this.y.setValue(t.y)}setOffset(t){this.x.setOffset(t.x),this.y.setOffset(t.y)}flattenOffset(){this.x.flattenOffset(),this.y.flattenOffset()}extractOffset(){this.x.extractOffset(),this.y.extractOffset()}__getValue(){return{x:this.x.__getValue(),y:this.y.__getValue()}}resetAnimation(t){this.x.resetAnimation(),this.y.resetAnimation(),t&&t(this.__getValue())}stopAnimation(t){this.x.stopAnimation(),this.y.stopAnimation(),t&&t(this.__getValue())}addListener(t){var s=String(f++),n=s=>{s.value;t(this.__getValue())};return this._listeners[s]={x:this.x.addListener(n),y:this.y.addListener(n)},s}removeListener(t){this.x.removeListener(this._listeners[t].x),this.y.removeListener(this._listeners[t].y),delete this._listeners[t]}removeAllListeners(){this.x.removeAllListeners(),this.y.removeAllListeners(),this._listeners={}}getLayout(){return{left:this.x,top:this.y}}getTranslateTransform(){return[{translateX:this.x},{translateY:this.y}]}}e.default=h}),311,[1,290,288,10]); -__d((function(g,r,i,a,m,e,d){'use strict';var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var s=t(r(d[1]));class n extends s.default{constructor(t){var s,n,o;super(),this._deceleration=null!==(s=t.deceleration)&&void 0!==s?s:.998,this._velocity=t.velocity,this._useNativeDriver=(0,r(d[2]).shouldUseNativeDriver)(t),this.__isInteraction=null!==(n=t.isInteraction)&&void 0!==n?n:!this._useNativeDriver,this.__iterations=null!==(o=t.iterations)&&void 0!==o?o:1}__getNativeAnimationConfig(){return{type:'decay',deceleration:this._deceleration,velocity:this._velocity,iterations:this.__iterations}}start(t,s,n,o,_){this.__active=!0,this._lastValue=t,this._fromValue=t,this._onUpdate=s,this.__onEnd=n,this._startTime=Date.now(),this._useNativeDriver?this.__startNativeAnimation(_):this._animationFrame=requestAnimationFrame(this.onUpdate.bind(this))}onUpdate(){var t=Date.now(),s=this._fromValue+this._velocity/(1-this._deceleration)*(1-Math.exp(-(1-this._deceleration)*(t-this._startTime)));this._onUpdate(s),Math.abs(this._lastValue-s)<.1?this.__debouncedOnEnd({finished:!0}):(this._lastValue=s,this.__active&&(this._animationFrame=requestAnimationFrame(this.onUpdate.bind(this))))}stop(){super.stop(),this.__active=!1,g.cancelAnimationFrame(this._animationFrame),this.__debouncedOnEnd({finished:!1})}}e.default=n}),312,[1,313,278]); -__d((function(g,r,i,a,m,_e,d){'use strict';var t=r(d[0]);Object.defineProperty(_e,"__esModule",{value:!0}),_e.default=void 0;var n=t(r(d[1])),e=1;_e.default=class{start(t,n,e,o,_){}stop(){this.__nativeId&&n.default.API.stopAnimation(this.__nativeId)}__getNativeAnimationConfig(){throw new Error('This animation type cannot be offloaded to native')}__debouncedOnEnd(t){var n=this.__onEnd;this.__onEnd=null,n&&n(t)}__startNativeAnimation(t){var o=e+":startAnimation";e+=1,n.default.API.setWaitingForIdentifier(o);try{var _=this.__getNativeAnimationConfig();t.__makeNative(_.platformConfig),this.__nativeId=n.default.generateNewAnimationId(),n.default.API.startAnimatingNode(this.__nativeId,t.__getNativeTag(),_,this.__debouncedOnEnd.bind(this))}catch(t){throw t}finally{n.default.API.unsetWaitingForIdentifier(o)}}}}),313,[1,278]); -__d((function(g,r,i,a,_m,e,d){'use strict';var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var s=t(r(d[1])),o=t(r(d[2])),n=t(r(d[3]));t(r(d[4]));class h extends s.default{constructor(t){var s,h,l,_,f,m,u,v,c,p,V;if(super(),this._overshootClamping=null!==(s=t.overshootClamping)&&void 0!==s&&s,this._restDisplacementThreshold=null!==(h=t.restDisplacementThreshold)&&void 0!==h?h:.001,this._restSpeedThreshold=null!==(l=t.restSpeedThreshold)&&void 0!==l?l:.001,this._initialVelocity=null!==(_=t.velocity)&&void 0!==_?_:0,this._lastVelocity=null!==(f=t.velocity)&&void 0!==f?f:0,this._toValue=t.toValue,this._delay=null!==(m=t.delay)&&void 0!==m?m:0,this._useNativeDriver=(0,r(d[5]).shouldUseNativeDriver)(t),this._platformConfig=t.platformConfig,this.__isInteraction=null!==(u=t.isInteraction)&&void 0!==u?u:!this._useNativeDriver,this.__iterations=null!==(v=t.iterations)&&void 0!==v?v:1,void 0!==t.stiffness||void 0!==t.damping||void 0!==t.mass)(0,n.default)(void 0===t.bounciness&&void 0===t.speed&&void 0===t.tension&&void 0===t.friction,'You can define one of bounciness/speed, tension/friction, or stiffness/damping/mass, but not more than one'),this._stiffness=null!==(c=t.stiffness)&&void 0!==c?c:100,this._damping=null!==(p=t.damping)&&void 0!==p?p:10,this._mass=null!==(V=t.mass)&&void 0!==V?V:1;else if(void 0!==t.bounciness||void 0!==t.speed){var T,y;(0,n.default)(void 0===t.tension&&void 0===t.friction&&void 0===t.stiffness&&void 0===t.damping&&void 0===t.mass,'You can define one of bounciness/speed, tension/friction, or stiffness/damping/mass, but not more than one');var b=o.default.fromBouncinessAndSpeed(null!==(T=t.bounciness)&&void 0!==T?T:8,null!==(y=t.speed)&&void 0!==y?y:12);this._stiffness=b.stiffness,this._damping=b.damping,this._mass=1}else{var M,D,P=o.default.fromOrigamiTensionAndFriction(null!==(M=t.tension)&&void 0!==M?M:40,null!==(D=t.friction)&&void 0!==D?D:7);this._stiffness=P.stiffness,this._damping=P.damping,this._mass=1}(0,n.default)(this._stiffness>0,'Stiffness value must be greater than 0'),(0,n.default)(this._damping>0,'Damping value must be greater than 0'),(0,n.default)(this._mass>0,'Mass value must be greater than 0')}__getNativeAnimationConfig(){var t;return{type:'spring',overshootClamping:this._overshootClamping,restDisplacementThreshold:this._restDisplacementThreshold,restSpeedThreshold:this._restSpeedThreshold,stiffness:this._stiffness,damping:this._damping,mass:this._mass,initialVelocity:null!==(t=this._initialVelocity)&&void 0!==t?t:this._lastVelocity,toValue:this._toValue,iterations:this.__iterations,platformConfig:this._platformConfig}}start(t,s,o,n,l){if(this.__active=!0,this._startPosition=t,this._lastPosition=this._startPosition,this._onUpdate=s,this.__onEnd=o,this._lastTime=Date.now(),this._frameTime=0,n instanceof h){var _=n.getInternalState();this._lastPosition=_.lastPosition,this._lastVelocity=_.lastVelocity,this._initialVelocity=this._lastVelocity,this._lastTime=_.lastTime}var f=()=>{this._useNativeDriver?this.__startNativeAnimation(l):this.onUpdate()};this._delay?this._timeout=setTimeout(f,this._delay):f()}getInternalState(){return{lastPosition:this._lastPosition,lastVelocity:this._lastVelocity,lastTime:this._lastTime}}onUpdate(){var t=Date.now();t>this._lastTime+64&&(t=this._lastTime+64);var s=(t-this._lastTime)/1e3;this._frameTime+=s;var o=this._damping,n=this._mass,h=this._stiffness,l=-this._initialVelocity,_=o/(2*Math.sqrt(h*n)),f=Math.sqrt(h/n),m=f*Math.sqrt(1-_*_),u=this._toValue-this._startPosition,v=0,c=0,p=this._frameTime;if(_<1){var V=Math.exp(-_*f*p);v=this._toValue-V*((l+_*f*u)/m*Math.sin(m*p)+u*Math.cos(m*p)),c=_*f*V*(Math.sin(m*p)*(l+_*f*u)/m+u*Math.cos(m*p))-V*(Math.cos(m*p)*(l+_*f*u)-m*u*Math.sin(m*p))}else{var T=Math.exp(-f*p);v=this._toValue-T*(u+(l+f*u)*p),c=T*(l*(p*f-1)+p*u*(f*f))}if(this._lastTime=t,this._lastPosition=v,this._lastVelocity=c,this._onUpdate(v),this.__active){var y=!1;this._overshootClamping&&0!==this._stiffness&&(y=this._startPositionthis._toValue:v18&&v<=44?p(v):M(v),s(2*w-w*w,l,.01));return{stiffness:n(A),damping:t(O)}}}}),315,[]); -__d((function(_g,_r,i,_a,m,e,d){'use strict';var t=_r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var s=t(_r(d[1])),a=t(_r(d[2])),r=t(_r(d[3])),n=t(_r(d[4])).default.API,h={r:0,g:0,b:0,a:1},l=1;function _(t){if(null==t)return null;if(o(t))return t;var s=(0,r.default)(t);if(null==s)return null;if('object'==typeof s){if(null!=s)return s}else if('number'==typeof s){return{r:(4278190080&s)>>>24,g:(16711680&s)>>>16,b:(65280&s)>>>8,a:(255&s)/255}}return null}function o(t){return t&&'number'==typeof t.r&&'number'==typeof t.g&&'number'==typeof t.b&&'number'==typeof t.a}function f(t){return t&&t.r instanceof s.default&&t.g instanceof s.default&&t.b instanceof s.default&&t.a instanceof s.default}class u extends a.default{constructor(t,a){super(),this._listeners={};var r=null!=t?t:h;if(f(r)){var n=r;this.r=n.r,this.g=n.g,this.b=n.b,this.a=n.a}else{var l,u=null!==(l=_(r))&&void 0!==l?l:h,v=h;o(u)?v=u:this.nativeColor=u,this.r=new s.default(v.r),this.g=new s.default(v.g),this.b=new s.default(v.b),this.a=new s.default(v.a)}(this.nativeColor||a&&a.useNativeDriver)&&this.__makeNative()}setValue(t){var s,a=!1;if(this.__isNative){var r=this.__getNativeTag();n.setWaitingForIdentifier(r.toString())}var l=null!==(s=_(t))&&void 0!==s?s:h;if(o(l)){var f=l;this.r.setValue(f.r),this.g.setValue(f.g),this.b.setValue(f.b),this.a.setValue(f.a),null!=this.nativeColor&&(this.nativeColor=null,a=!0)}else{var u=l;this.nativeColor!==u&&(this.nativeColor=u,a=!0)}if(this.__isNative){var v=this.__getNativeTag();a&&n.updateAnimatedNodeConfig(v,this.__getNativeConfig()),n.unsetWaitingForIdentifier(v.toString())}}setOffset(t){this.r.setOffset(t.r),this.g.setOffset(t.g),this.b.setOffset(t.b),this.a.setOffset(t.a)}flattenOffset(){this.r.flattenOffset(),this.g.flattenOffset(),this.b.flattenOffset(),this.a.flattenOffset()}extractOffset(){this.r.extractOffset(),this.g.extractOffset(),this.b.extractOffset(),this.a.extractOffset()}addListener(t){var s=String(l++),a=s=>{s.value;t(this.__getValue())};return this._listeners[s]={r:this.r.addListener(a),g:this.g.addListener(a),b:this.b.addListener(a),a:this.a.addListener(a)},s}removeListener(t){this.r.removeListener(this._listeners[t].r),this.g.removeListener(this._listeners[t].g),this.b.removeListener(this._listeners[t].b),this.a.removeListener(this._listeners[t].a),delete this._listeners[t]}removeAllListeners(){this.r.removeAllListeners(),this.g.removeAllListeners(),this.b.removeAllListeners(),this.a.removeAllListeners(),this._listeners={}}stopAnimation(t){this.r.stopAnimation(),this.g.stopAnimation(),this.b.stopAnimation(),this.a.stopAnimation(),t&&t(this.__getValue())}resetAnimation(t){this.r.resetAnimation(),this.g.resetAnimation(),this.b.resetAnimation(),this.a.resetAnimation(),t&&t(this.__getValue())}__getValue(){return null!=this.nativeColor?this.nativeColor:"rgba("+this.r.__getValue()+", "+this.g.__getValue()+", "+this.b.__getValue()+", "+this.a.__getValue()+")"}__attach(){this.r.__addChild(this),this.g.__addChild(this),this.b.__addChild(this),this.a.__addChild(this),super.__attach()}__detach(){this.r.__removeChild(this),this.g.__removeChild(this),this.b.__removeChild(this),this.a.__removeChild(this),super.__detach()}__makeNative(t){this.r.__makeNative(t),this.g.__makeNative(t),this.b.__makeNative(t),this.a.__makeNative(t),super.__makeNative(t)}__getNativeConfig(){return{type:'color',r:this.r.__getNativeTag(),g:this.g.__getNativeTag(),b:this.b.__getNativeTag(),a:this.a.__getNativeTag(),nativeColor:this.nativeColor}}}e.default=u}),316,[1,290,288,36,278]); -__d((function(g,r,i,a,m,e,d){'use strict';var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;t(r(d[1])),t(r(d[2])),t(r(d[3]));var s,n=t(r(d[4])),o=t(r(d[5]));t(r(d[6]));class _ extends o.default{constructor(t){var o,_,h,u,l;super(),this._toValue=t.toValue,this._easing=null!==(o=t.easing)&&void 0!==o?o:(s||(s=n.default.inOut(n.default.ease)),s),this._duration=null!==(_=t.duration)&&void 0!==_?_:500,this._delay=null!==(h=t.delay)&&void 0!==h?h:0,this.__iterations=null!==(u=t.iterations)&&void 0!==u?u:1,this._useNativeDriver=(0,r(d[7]).shouldUseNativeDriver)(t),this._platformConfig=t.platformConfig,this.__isInteraction=null!==(l=t.isInteraction)&&void 0!==l?l:!this._useNativeDriver}__getNativeAnimationConfig(){for(var t=[],s=Math.round(this._duration/16.666666666666668),n=0;n{0!==this._duration||this._useNativeDriver?(this._startTime=Date.now(),this._useNativeDriver?this.__startNativeAnimation(_):this._animationFrame=requestAnimationFrame(this.onUpdate.bind(this))):(this._onUpdate(this._toValue),this.__debouncedOnEnd({finished:!0}))};this._delay?this._timeout=setTimeout(h,this._delay):h()}onUpdate(){var t=Date.now();if(t>=this._startTime+this._duration)return 0===this._duration?this._onUpdate(this._toValue):this._onUpdate(this._fromValue+this._easing(1)*(this._toValue-this._fromValue)),void this.__debouncedOnEnd({finished:!0});this._onUpdate(this._fromValue+this._easing((t-this._startTime)/this._duration)*(this._toValue-this._fromValue)),this.__active&&(this._animationFrame=requestAnimationFrame(this.onUpdate.bind(this)))}stop(){super.stop(),this.__active=!1,clearTimeout(this._timeout),g.cancelAnimationFrame(this._animationFrame),this.__debouncedOnEnd({finished:!1})}}e.default=_}),317,[1,290,311,291,318,313,316,278]); -__d((function(g,r,i,a,m,e,d){var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var u=t(r(d[1]));e.default=u.default}),318,[1,319]); -__d((function(g,r,i,a,m,e,d){'use strict';var t=r(d[0]);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var u,c=t(r(d[1]));class s{static step0(t){return t>0?1:0}static step1(t){return t>=1?1:0}static linear(t){return t}static ease(t){return u||(u=s.bezier(.42,0,1,1)),u(t)}static quad(t){return t*t}static cubic(t){return t*t*t}static poly(t){return u=>Math.pow(u,t)}static sin(t){return 1-Math.cos(t*Math.PI/2)}static circle(t){return 1-Math.sqrt(1-t*t)}static exp(t){return Math.pow(2,10*(t-1))}static elastic(t){void 0===t&&(t=1);var u=t*Math.PI;return t=>1-Math.pow(Math.cos(t*Math.PI/2),3)*Math.cos(t*u)}static back(t){return void 0===t&&(t=1.70158),u=>u*u*((t+1)*u-t)}static bounce(t){if(t<.36363636363636365)return 7.5625*t*t;if(t<.7272727272727273){var u=t-.5454545454545454;return 7.5625*u*u+.75}if(t<.9090909090909091){var c=t-.8181818181818182;return 7.5625*c*c+.9375}var s=t-.9545454545454546;return 7.5625*s*s+.984375}static bezier(t,u,s,n){return(0,c.default)(t,u,s,n)}static in(t){return t}static out(t){return u=>1-t(1-u)}static inOut(t){return u=>u<.5?t(2*u)/2:1-t(2*(1-u))/2}}e.default=s}),319,[1,320]); +'use strict';"production"!==process.env.NODE_ENV&&(function(){'undefined'!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&'function'==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);function n(n,t){var a=n.length;n.push(t),i(n,t,a)}function t(n){return 0===n.length?null:n[0]}function a(n){if(0===n.length)return null;var t=n[0],a=n.pop();return a!==t&&(n[0]=a,l(n,a,0)),t}function i(n,t,a){for(var i=a;i>0;){var l=i-1>>>1,o=n[l];if(!(u(o,t)>0))return;n[l]=t,n[i]=o,i=l}}function l(n,t,a){for(var i=a,l=n.length,o=l>>>1;il)||n&&!M());){var u=p.callback;if('function'==typeof u){p.callback=null,v=p.priorityLevel;var o=u(p.expirationTime<=l);l=e.unstable_now(),'function'==typeof o?p.callback=o:p===t(c)&&a(c),k(l)}else a(c);p=t(c)}if(null!==p)return!0;var f=t(_);return null!==f&&K(E,f.startTime-l),!1}var C=!1,A=null,P=-1,S=5,D=-1;function M(){return!(e.unstable_now()-D125?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):S=n>0?Math.floor(1e3/n):5},e.unstable_getCurrentPriorityLevel=function(){return v},e.unstable_getFirstCallbackNode=function(){return t(c)},e.unstable_next=function(n){var t;switch(v){case 1:case 2:case 3:t=3;break;default:t=v}var a=v;v=t;try{return n()}finally{v=a}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=F,e.unstable_runWithPriority=function(n,t){switch(n){case 1:case 2:case 3:case 4:case 5:break;default:n=3}var a=v;v=n;try{return t()}finally{v=a}},e.unstable_scheduleCallback=function(a,i,l){var u,o,f=e.unstable_now();if('object'==typeof l&&null!==l){var s=l.delay;u='number'==typeof s&&s>0?f+s:f}else u=f;switch(a){case 1:o=-1;break;case 2:o=250;break;case 5:o=1073741823;break;case 4:o=1e4;break;default:o=5e3}var p=u+o,v={id:b++,callback:i,priorityLevel:a,startTime:u,expirationTime:p,sortIndex:-1};return u>f?(v.sortIndex=u,n(_,v),null===t(c)&&v===t(_)&&(T?N():T=!0,K(E,u-f))):(v.sortIndex=p,n(c,v),O||y||(O=!0,H(I))),v},e.unstable_shouldYield=M,e.unstable_wrapCallback=function(n){var t=v;return function(){var a=v;v=t;try{return n.apply(this,arguments)}finally{v=a}}},'undefined'!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&'function'==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)})()}),92,[]); +__d((function(e,t,n,r,a,o,i){ +/** + * @license React + * react-dom.development.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +'use strict';"production"!==process.env.NODE_ENV&&(function(){'undefined'!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&'function'==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var e=t(i[0]),n=t(i[1]),r=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,a=!1;function l(e){if(!a){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r1?t-1:0),r=1;r2&&('o'===e[0]||'O'===e[0])&&('n'===e[1]||'N'===e[1]))}function pe(e,t,n,r){if(null!==n&&n.type===re)return!1;switch(typeof t){case'function':case'symbol':return!0;case'boolean':if(r)return!1;if(null!==n)return!n.acceptsBooleans;var a=e.toLowerCase().slice(0,5);return'data-'!==a&&'aria-'!==a;default:return!1}}function he(e,t,n,r){if(null==t)return!0;if(pe(e,t,n,r))return!0;if(r)return!1;if(null!==n)switch(n.type){case ae:return!t;case oe:return!1===t;case ie:return isNaN(t);case le:return isNaN(t)||t<1}return!1}function me(e){return ge.hasOwnProperty(e)?ge[e]:null}function ve(e,t,n,r,a,o,i){this.acceptsBooleans=2===t||t===ae||t===oe,this.attributeName=r,this.attributeNamespace=a,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=i}var ge={};['children','dangerouslySetInnerHTML','defaultValue','defaultChecked','innerHTML','suppressContentEditableWarning','suppressHydrationWarning','style'].forEach((function(e){ge[e]=new ve(e,re,!1,e,null,!1,!1)})),[['acceptCharset','accept-charset'],['className','class'],['htmlFor','for'],['httpEquiv','http-equiv']].forEach((function(e){var t=e[0],n=e[1];ge[t]=new ve(t,1,!1,n,null,!1,!1)})),['contentEditable','draggable','spellCheck','value'].forEach((function(e){ge[e]=new ve(e,2,!1,e.toLowerCase(),null,!1,!1)})),['autoReverse','externalResourcesRequired','focusable','preserveAlpha'].forEach((function(e){ge[e]=new ve(e,2,!1,e,null,!1,!1)})),['allowFullScreen','async','autoFocus','autoPlay','controls','default','defer','disabled','disablePictureInPicture','disableRemotePlayback','formNoValidate','hidden','loop','noModule','noValidate','open','playsInline','readOnly','required','reversed','scoped','seamless','itemScope'].forEach((function(e){ge[e]=new ve(e,ae,!1,e.toLowerCase(),null,!1,!1)})),['checked','multiple','muted','selected'].forEach((function(e){ge[e]=new ve(e,ae,!0,e,null,!1,!1)})),['capture','download'].forEach((function(e){ge[e]=new ve(e,oe,!1,e,null,!1,!1)})),['cols','rows','size','span'].forEach((function(e){ge[e]=new ve(e,le,!1,e,null,!1,!1)})),['rowSpan','start'].forEach((function(e){ge[e]=new ve(e,ie,!1,e.toLowerCase(),null,!1,!1)}));var ye=/[\-\:]([a-z])/g,be=function(e){return e[1].toUpperCase()};['accent-height','alignment-baseline','arabic-form','baseline-shift','cap-height','clip-path','clip-rule','color-interpolation','color-interpolation-filters','color-profile','color-rendering','dominant-baseline','enable-background','fill-opacity','fill-rule','flood-color','flood-opacity','font-family','font-size','font-size-adjust','font-stretch','font-style','font-variant','font-weight','glyph-name','glyph-orientation-horizontal','glyph-orientation-vertical','horiz-adv-x','horiz-origin-x','image-rendering','letter-spacing','lighting-color','marker-end','marker-mid','marker-start','overline-position','overline-thickness','paint-order','panose-1','pointer-events','rendering-intent','shape-rendering','stop-color','stop-opacity','strikethrough-position','strikethrough-thickness','stroke-dasharray','stroke-dashoffset','stroke-linecap','stroke-linejoin','stroke-miterlimit','stroke-opacity','stroke-width','text-anchor','text-decoration','text-rendering','underline-position','underline-thickness','unicode-bidi','unicode-range','units-per-em','v-alphabetic','v-hanging','v-ideographic','v-mathematical','vector-effect','vert-adv-y','vert-origin-x','vert-origin-y','word-spacing','writing-mode','xmlns:xlink','x-height'].forEach((function(e){var t=e.replace(ye,be);ge[t]=new ve(t,1,!1,e,null,!1,!1)})),['xlink:actuate','xlink:arcrole','xlink:role','xlink:show','xlink:title','xlink:type'].forEach((function(e){var t=e.replace(ye,be);ge[t]=new ve(t,1,!1,e,'http://www.w3.org/1999/xlink',!1,!1)})),['xml:base','xml:lang','xml:space'].forEach((function(e){var t=e.replace(ye,be);ge[t]=new ve(t,1,!1,e,'http://www.w3.org/XML/1998/namespace',!1,!1)})),['tabIndex','crossOrigin'].forEach((function(e){ge[e]=new ve(e,1,!1,e.toLowerCase(),null,!1,!1)}));ge.xlinkHref=new ve('xlinkHref',1,!1,'xlink:href','http://www.w3.org/1999/xlink',!0,!1),['src','href','action','formAction'].forEach((function(e){ge[e]=new ve(e,1,!1,e.toLowerCase(),null,!0,!0)}));var we=/^[\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,ke=!1;function Se(e){!ke&&we.test(e)&&(ke=!0,u("A future version of React will block javascript: URLs as a security precaution. Use event handlers instead if you can. If you need to generate unsafe HTML try using dangerouslySetInnerHTML instead. React was passed %s.",JSON.stringify(e)))}function xe(e,t,n,r){if(r.mustUseProperty)return e[r.propertyName];G(n,t),r.sanitizeURL&&Se(''+n);var a=r.attributeName,o=null;if(r.type===oe){if(e.hasAttribute(a)){var i=e.getAttribute(a);return''===i||(he(t,n,r,!1)?i:i===''+n?n:i)}}else if(e.hasAttribute(a)){if(he(t,n,r,!1))return e.getAttribute(a);if(r.type===ae)return n;o=e.getAttribute(a)}return he(t,n,r,!1)?null===o?n:o:o===''+n?n:o}function Ce(e,t,n,r){if(de(t)){if(!e.hasAttribute(t))return void 0===n?void 0:null;var a=e.getAttribute(t);return G(n,t),a===''+n?n:a}}function Ee(e,t,n,r){var a=me(t);if(!fe(t,a,r))if(he(t,n,a,r)&&(n=null),r||null===a){if(de(t)){var o=t;null===n?e.removeAttribute(o):(G(n,t),e.setAttribute(o,''+n))}}else if(a.mustUseProperty){var i=a.propertyName;if(null===n){var l=a.type;e[i]=l!==ae&&''}else e[i]=n}else{var u=a.attributeName,s=a.attributeNamespace;if(null===n)e.removeAttribute(u);else{var c,d=a.type;d===ae||d===oe&&!0===n?c='':(G(n,u),c=''+n,a.sanitizeURL&&Se(c.toString())),s?e.setAttributeNS(s,u,c):e.setAttribute(u,c)}}}var Te=Symbol.for('react.element'),Re=Symbol.for('react.portal'),Pe=Symbol.for('react.fragment'),De=Symbol.for('react.strict_mode'),_e=Symbol.for('react.profiler'),Ne=Symbol.for('react.provider'),Le=Symbol.for('react.context'),Ie=Symbol.for('react.forward_ref'),ze=Symbol.for('react.suspense'),Fe=Symbol.for('react.suspense_list'),Me=Symbol.for('react.memo'),Oe=Symbol.for('react.lazy'),Ue=(Symbol.for('react.scope'),Symbol.for('react.debug_trace_mode'),Symbol.for('react.offscreen')),Ae=(Symbol.for('react.legacy_hidden'),Symbol.for('react.cache'),Symbol.for('react.tracing_marker'),Symbol.iterator),We='@@iterator';function je(e){if(null===e||'object'!=typeof e)return null;var t=Ae&&e[Ae]||e[We];return'function'==typeof t?t:null}var Be,He,Ve,Ye,Qe,qe,$e,Ke=Object.assign,Xe=0;function Ge(){}function Ze(){if(0===Xe){Be=console.log,He=console.info,Ve=console.warn,Ye=console.error,Qe=console.group,qe=console.groupCollapsed,$e=console.groupEnd;var e={configurable:!0,enumerable:!0,value:Ge,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}Xe++}function Je(){if(0===--Xe){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:Ke({},e,{value:Be}),info:Ke({},e,{value:He}),warn:Ke({},e,{value:Ve}),error:Ke({},e,{value:Ye}),group:Ke({},e,{value:Qe}),groupCollapsed:Ke({},e,{value:qe}),groupEnd:Ke({},e,{value:$e})})}Xe<0&&u("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}Ge.__reactDisabledLog=!0;var et,tt=r.ReactCurrentDispatcher;function nt(e,t,n){if(void 0===et)try{throw Error()}catch(e){var r=e.stack.trim().match(/\n( *(at )?)/);et=r&&r[1]||''}return'\n'+et+e}var rt,at=!1,ot='function'==typeof WeakMap?WeakMap:Map;function it(e,t){if(!e||at)return'';var n,r=rt.get(e);if(void 0!==r)return r;at=!0;var a,o=Error.prepareStackTrace;Error.prepareStackTrace=void 0,a=tt.current,tt.current=null,Ze();try{if(t){var i=function(){throw Error()};if(Object.defineProperty(i.prototype,'props',{set:function(){throw Error()}}),'object'==typeof Reflect&&Reflect.construct){try{Reflect.construct(i,[])}catch(e){n=e}Reflect.construct(e,[],i)}else{try{i.call()}catch(e){n=e}e.call(i.prototype)}}else{try{throw Error()}catch(e){n=e}e()}}catch(t){if(t&&n&&'string'==typeof t.stack){for(var l=t.stack.split('\n'),u=n.stack.split('\n'),s=l.length-1,c=u.length-1;s>=1&&c>=0&&l[s]!==u[c];)c--;for(;s>=1&&c>=0;s--,c--)if(l[s]!==u[c]){if(1!==s||1!==c)do{if(s--,--c<0||l[s]!==u[c]){var d='\n'+l[s].replace(' at new ',' at ');return e.displayName&&d.includes('')&&(d=d.replace('',e.displayName)),'function'==typeof e&&rt.set(e,d),d}}while(s>=1&&c>=0);break}}}finally{at=!1,tt.current=a,Je(),Error.prepareStackTrace=o}var f=e?e.displayName||e.name:'',p=f?nt(f):'';return'function'==typeof e&&rt.set(e,p),p}function lt(e,t,n){return it(e,!1)}function ut(e,t,n){if(null==e)return'';if('function'==typeof e)return it(e,!(!(r=e.prototype)||!r.isReactComponent));var r;if('string'==typeof e)return nt(e);switch(e){case ze:return nt('Suspense');case Fe:return nt('SuspenseList')}if('object'==typeof e)switch(e.$$typeof){case Ie:return lt(e.render);case Me:return ut(e.type,t,n);case Oe:var a=e,o=a._payload,i=a._init;try{return ut(i(o),t,n)}catch(e){}}return''}function st(e){e._debugOwner&&e._debugOwner.type,e._debugSource;switch(e.tag){case m:return nt(e.type);case T:return nt('Lazy');case x:return nt('Suspense');case D:return nt('SuspenseList');case c:case f:case E:return lt(e.type);case k:return lt(e.type.render);case d:return it(e.type,!0);default:return''}}function ct(e){try{var t='',n=e;do{t+=st(n),n=n.return}while(n);return t}catch(e){return'\nError generating stack: '+e.message+'\n'+e.stack}}function dt(e,t,n){var r=e.displayName;if(r)return r;var a=t.displayName||t.name||'';return''!==a?n+"("+a+")":n}function ft(e){return e.displayName||'Context'}function pt(e){if(null==e)return null;if('number'==typeof e.tag&&u("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),'function'==typeof e)return e.displayName||e.name||null;if('string'==typeof e)return e;switch(e){case Pe:return'Fragment';case Re:return'Portal';case _e:return'Profiler';case De:return'StrictMode';case ze:return'Suspense';case Fe:return'SuspenseList'}if('object'==typeof e)switch(e.$$typeof){case Le:return ft(e)+'.Consumer';case Ne:return ft(e._context)+'.Provider';case Ie:return dt(e,e.render,'ForwardRef');case Me:var t=e.displayName||null;return null!==t?t:pt(e.type)||'Memo';case Oe:var n=e,r=n._payload,a=n._init;try{return pt(a(r))}catch(e){return null}}return null}function ht(e){return e.displayName||'Context'}function mt(e){var t,n,r,a,o=e.tag,i=e.type;switch(o){case I:return'Cache';case b:return ht(i)+'.Consumer';case w:return ht(i._context)+'.Provider';case P:return'DehydratedFragment';case k:return t=i,n=i.render,r='ForwardRef',a=n.displayName||n.name||'',t.displayName||(''!==a?r+"("+a+")":r);case g:return'Fragment';case m:return i;case h:return'Portal';case p:return'Root';case v:return'Text';case T:return pt(i);case y:return i===De?'StrictMode':'Mode';case N:return'Offscreen';case S:return'Profiler';case _:return'Scope';case x:return'Suspense';case D:return'SuspenseList';case z:return'TracingMarker';case d:case c:case R:case f:case C:case E:if('function'==typeof i)return i.displayName||i.name||null;if('string'==typeof i)return i}return null}rt=new ot;var vt=r.ReactDebugCurrentFrame,gt=null,yt=!1;function bt(){if(null===gt)return null;var e=gt._debugOwner;return null!=e?mt(e):null}function wt(){return null===gt?'':ct(gt)}function kt(){vt.getCurrentStack=null,gt=null,yt=!1}function St(e){vt.getCurrentStack=null===e?null:wt,gt=e,yt=!1}function xt(e){yt=e}function Ct(e){return''+e}function Et(e){switch(typeof e){case'boolean':case'number':case'string':case'undefined':return e;case'object':return ne(e),e;default:return''}}var Tt={button:!0,checkbox:!0,image:!0,hidden:!0,radio:!0,reset:!0,submit:!0};function Rt(e,t){Tt[t.type]||t.onChange||t.onInput||t.readOnly||t.disabled||null==t.value||u("You provided a `value` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultValue`. Otherwise, set either `onChange` or `readOnly`."),t.onChange||t.readOnly||t.disabled||null==t.checked||u("You provided a `checked` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultChecked`. Otherwise, set either `onChange` or `readOnly`.")}function Pt(e){var t=e.type,n=e.nodeName;return n&&'input'===n.toLowerCase()&&('checkbox'===t||'radio'===t)}function Dt(e){return e._valueTracker}function _t(e){e._valueTracker=null}function Nt(e){var t='';return e?t=Pt(e)?e.checked?'true':'false':e.value:t}function Lt(e){var t=Pt(e)?'checked':'value',n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);ne(e[t]);var r=''+e[t];if(!e.hasOwnProperty(t)&&void 0!==n&&'function'==typeof n.get&&'function'==typeof n.set){var a=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return a.call(this)},set:function(e){ne(e),r=''+e,o.call(this,e)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(e){ne(e),r=''+e},stopTracking:function(){_t(e),delete e[t]}}}}function It(e){Dt(e)||(e._valueTracker=Lt(e))}function zt(e){if(!e)return!1;var t=Dt(e);if(!t)return!0;var n=t.getValue(),r=Nt(e);return r!==n&&(t.setValue(r),!0)}function Ft(e){if(void 0===(e=e||('undefined'!=typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}var Mt=!1,Ot=!1,Ut=!1,At=!1;function Wt(e){return'checkbox'===e.type||'radio'===e.type?null!=e.checked:null!=e.value}function jt(e,t){var n=e,r=t.checked;return Ke({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=r?r:n._wrapperState.initialChecked})}function Bt(e,t){Rt(0,t),void 0===t.checked||void 0===t.defaultChecked||Ot||(u("%s contains an input of type %s with both checked and defaultChecked props. Input elements must be either controlled or uncontrolled (specify either the checked prop, or the defaultChecked prop, but not both). Decide between using a controlled or uncontrolled input element and remove one of these props. More info: https://reactjs.org/link/controlled-components",bt()||'A component',t.type),Ot=!0),void 0===t.value||void 0===t.defaultValue||Mt||(u("%s contains an input of type %s with both value and defaultValue props. Input elements must be either controlled or uncontrolled (specify either the value prop, or the defaultValue prop, but not both). Decide between using a controlled or uncontrolled input element and remove one of these props. More info: https://reactjs.org/link/controlled-components",bt()||'A component',t.type),Mt=!0);var n=e,r=null==t.defaultValue?'':t.defaultValue;n._wrapperState={initialChecked:null!=t.checked?t.checked:t.defaultChecked,initialValue:Et(null!=t.value?t.value:r),controlled:Wt(t)}}function Ht(e,t){var n=e,r=t.checked;null!=r&&Ee(n,'checked',r,!1)}function Vt(e,t){var n=e,r=Wt(t);n._wrapperState.controlled||!r||At||(u("A component is changing an uncontrolled input to be controlled. This is likely caused by the value changing from undefined to a defined value, which should not happen. Decide between using a controlled or uncontrolled input element for the lifetime of the component. More info: https://reactjs.org/link/controlled-components"),At=!0),!n._wrapperState.controlled||r||Ut||(u("A component is changing a controlled input to be uncontrolled. This is likely caused by the value changing from a defined to undefined, which should not happen. Decide between using a controlled or uncontrolled input element for the lifetime of the component. More info: https://reactjs.org/link/controlled-components"),Ut=!0),Ht(e,t);var a=Et(t.value),o=t.type;if(null!=a)'number'===o?(0===a&&''===n.value||n.value!=a)&&(n.value=Ct(a)):n.value!==Ct(a)&&(n.value=Ct(a));else if('submit'===o||'reset'===o)return void n.removeAttribute('value');t.hasOwnProperty('value')?$t(n,t.type,a):t.hasOwnProperty('defaultValue')&&$t(n,t.type,Et(t.defaultValue)),null==t.checked&&null!=t.defaultChecked&&(n.defaultChecked=!!t.defaultChecked)}function Yt(e,t,n){var r=e;if(t.hasOwnProperty('value')||t.hasOwnProperty('defaultValue')){var a=t.type;if(('submit'===a||'reset'===a)&&(void 0===t.value||null===t.value))return;var o=Ct(r._wrapperState.initialValue);n||o!==r.value&&(r.value=o),r.defaultValue=o}var i=r.name;''!==i&&(r.name=''),r.defaultChecked=!r.defaultChecked,r.defaultChecked=!!r._wrapperState.initialChecked,''!==i&&(r.name=i)}function Qt(e,t){var n=e;Vt(n,t),qt(n,t)}function qt(e,t){var n=t.name;if('radio'===t.type&&null!=n){for(var r=e;r.parentNode;)r=r.parentNode;G(n,'name');for(var a=r.querySelectorAll('input[name='+JSON.stringify(''+n)+'][type="radio"]'),o=0;o.")))})):null!=n.dangerouslySetInnerHTML&&(Gt||(Gt=!0,u("Pass a `value` prop if you set dangerouslyInnerHTML so React knows which value should be selected.")))),null==n.selected||Kt||(u("Use the `defaultValue` or `value` props on must be a scalar value if `multiple` is false.%s",n,rn())}}}function ln(e,t,n,r){var a=e.options;if(t){for(var o=n,i={},l=0;l.');return Ke({},t,{value:void 0,defaultValue:void 0,children:Ct(n._wrapperState.initialValue)})}function mn(e,t){var n=e;Rt(0,t),void 0===t.value||void 0===t.defaultValue||pn||(u("%s contains a textarea with both value and defaultValue props. Textarea elements must be either controlled or uncontrolled (specify either the value prop, or the defaultValue prop, but not both). Decide between using a controlled or uncontrolled textarea and remove one of these props. More info: https://reactjs.org/link/controlled-components",bt()||'A component'),pn=!0);var r=t.value;if(null==r){var a=t.children,o=t.defaultValue;if(null!=a){if(u("Use the `defaultValue` or `value` props instead of setting children on